git / GitHub notes

git / GitHub notes

Find all report in HOME

for d in `find $HOME -name ".git"`; do 
  cd $d/..; 
  echo `pwd`:; 
  git status; 

working with upstreams

  1. fork repo from main repo to account
  2. clone repo locally
  3. edit local files
  4. add and commit changes
  5. push changes to local account
  6. create pull request with change to merge upstream

Add upstream repo

Configuring a remote for a fork – User Documentation

  1. List the current configured remote repository for your fork.
$ git remote -v
origin (fetch)
origin (push)
  1. Specify a new remote upstream repository that will be synced with the fork.
$ git remote add upstream
  1. Verify the new upstream repository you’ve specified for your fork.
$ git remote -v
origin (fetch)
origin (push)
upstream (fetch)
upstream (push)

Update Locate Repo from upstream

  • have an alias named gmu setup for following command sequence
  • must have upstream added to repo
$ git fetch origin -v
$ git fetch upstream -v
$ git merge upstream/master

Rebase repo

Don’t Be Scared of git rebase | I care, I share, I’m Nathan LeClaire.

$ git status

  • commit or stash any dangling work
$ git remote add upstream
$ git fetch upstream
$ git rebase -i upstream/master