git / GitHub notes
Find all report in HOME
1
2
3
4
5
6
|
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.
1
2
3
|
$ 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.
1
|
$ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
|
- Verify the new upstream repository you’ve specified for your fork.
1
2
3
4
5
|
$ 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
1
2
3
|
$ 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
1
2
3
|
$ git remote add upstream https://github.com/cdwlabs/auto-pilot
$ git fetch upstream
$ git rebase -i upstream/master
|