As the title suggests, this post will cover all the essential day to day GIT commands that you will need on a daily basis.
Tired of looking around for the essential GIT commands? Well look no further. Go ahead and bookmark this page. Here we will cover all the essential GIT commands that you would need on a day to day basis.
We are not concerned with those rare extreme scenarios. No, this is going to be just the GIT list you need.
Completely new to GIT? Checkout: Introduction to Version Control System
How To Copy Commits From One Branch Into Another Branch?
Say you are on
branch_A and you want to copy some commits of this into
branch_B. Follow the steps below for this purpose:
Check out the branch that has the commits which needs to be copied over.
git checkout branch_A
Now, get the list of commits that you have made on this branch via the
git log command.
git log --oneline
Say you have a new commit on this branch with id
81d3589 (HEAD -> branch_A) added file2 a7f1db5 (master, branch_B) initial File
Keep a note of this commit id and now move onto your second branch.
git checkout branch_B
From this branch, now we will use the
cherry-pick command to copy the changes from
git cherry-pick 81d3589
Simple as that. you have the changes now copied to branch_B.
More to come soon…