Table of Contents
git / GitHub notes
Find all report in HOME
for d in `find $HOME -name ".git"`; do
cd $d/..;
echo `pwd`:;
git status;
echo;
done
working with upstreams
- fork repo from main repo to account
- clone repo locally
- edit local files
- add and commit changes
- push changes to local account
- create pull request with change to merge upstream
Add upstream repo
Configuring a remote for a fork – User Documentation
- 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)
- 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
- 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
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 https://github.com/cdwlabs/auto-pilot
$ git fetch upstream
$ git rebase -i upstream/master