git / GitHub notes

git / GitHub notes

Find all report in HOME

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

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  https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
  1. Specify a new remote upstream repository that will be synced with the fork.
$ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
  1. Verify the new upstream repository you’ve specified for your fork.
$ git remote -v
origin    https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
origin    https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
upstream  https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch)
upstream  https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (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

  • do not know what rebasing means
git status
commit or stash any dangling work
git remote add upstream https://github.com/cdwlabs/auto-pilot
git fetch upstream
git rebase -i upstream/master

 

#7-notes #coding/git