Git Practice repository
All content is taken from https://github.com/github/docs.
Fork this repository and practice!
[modify_about_merge] -> [pr_branch]
- Settings - Features - Issues
- Make "New issue" at Issues
$ git checkout -b issue_test
$ git add .
$ git commit -m "test issue #1"
$ git push origin issue_test
[conflict_branch] -> [modify_about_merge]
[conflict_branch2] -> [modify_about_merge]
$ git checkout -b conflict_branch2 origin/conflict_branch2
$ git merge modify_about_merge
# conflict resolve
$ git add .
$ git commit -m "conflict resolve"
$ git push origin conflict_branch2
[squash_branch] -> [pr_branch]
[squash_branch2] -> [pr_branch]
$ git checkout -b squash_branch2 origin/squash_branch2
$ git log --pretty=oneline # check commit history
$ git rebase -i a5909f529078f558156297977d851d1d458fd233
pick 166267a squash commit 1
s f93aa5b squash commit 2
s 5a9ad96 squash commit 3
s 5d2909a squash commit 4
s d86c1a8 squash commit 5
$ git log --pretty=oneline # check squash result
a3ae723519d4c38b49c7f4189e87152ec4f4067a (HEAD -> squash_branch2) squash commit 1~5
a5909f529078f558156297977d851d1d458fd233 (master) add github contents
f20a4725e5374c6d7cb6b4a50d97d008fdd98aca Initial commit
$ git push -f origin squash_branch2
$ git checkout -b amend_branch
# modify configuring-commit-rebasing-for-pull-requests.md file
$ git add .
$ git commit -m "amend commit"
# modify README.md
$ git add .
$ git commit --amend
$ git push origin amend_branch
$ git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
$ git fetch --all
$ git pull --all