code> | |
# So far, each time we merged, there was a fork | |
# in the history. Forks for real branches are good, | |
# but each concurrent change doesn't need a fork. | |
# 1. Checkout a new branch, change new.txt | |
$ git checkout -b working | |
$ echo "line5" >> new.txt | |
$ git commit -a -m "Added new line5." | |
# 2. Checkout master, change new-b.txt | |
$ git checkout master | |
$ echo "line3" >> new-b.txt" | |
$ git commit -a -m "Added new-b line3." | |
# 3. Go back to working, note the fork | |
$ git checkout working | |
$ git l working master | |
# 4. Rebase your work on top of master, no more fork | |
$ git rebase master | |
$ git l working master | |
# 5. Checkout master, merge in working | |
$ git checkout master | |
# Note in the output it said "Fast-forward". | |
# Unless told --no-ff, git will avoid needless | |
# merge commits | |
$ git l | |
# No (unneeded) forks |
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND