https://github.com/mhtkarakose/learngitbranching.js.org
https://github.com/mhtkarakose/learngitbranching.js.org
git learngitbranching
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mhtkarakose/learngitbranching.js.org
- Owner: mhtkarakose
- Created: 2018-11-21T19:11:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-08T03:23:56.000Z (over 7 years ago)
- Last Synced: 2025-01-05T17:21:20.290Z (over 1 year ago)
- Topics: git, learngitbranching
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#1: Introduction Sequence
## Git Commits
git commit
##Git Branches
git checkout -b bugFix
##Branches and Merging
git checkout -b bugFix
git commit
git checkout master
git merge
##Git Rebase
git checkout -b bugFix
git commit
git checkout master
git commit
git checkout bugFix
git commit
git rebase master
- - - - - - - -
#2 Ramping Up
##HEAD
HEAD always points to the most recent commit which is reflected in the working tree.
git checkout C4^
##
git branch -f bugFix HEAD~3
git checkout C6
git branch -f master HEAD~0
git checkout C1
##
git reset HEAD~1
git checkout pushed
git revert HEAD
- - - - - - - -
#3 Moving Work Around
## Cherry-pick Intro
git cherry-pick <...>
git cherry-pick C3 C4 C7
Git cherry-pick is great when you know which commits you want (and you know their corresponding hashes)
## git rebase -i HEAD~4
- - - - - - - -
#4 A Mixed Bag
## 1: Grabbing Just 1 Commit
git rebase -i HEAD~3
git checkout master
git cherry-pick C4
## 2: Juggling Commits