Adhoc
- Renaming the branch
git branch -M <new-branch-name>
- Create and checkout to a new branch
git checkout -b <new-branch>
- Add only modified files
Git Merge
Merge Conflicts
- Conflict arises when git tries to merge the changes and findouts conflicting information from two different references
- In the class we had differnt lines in line number 2
- Merge conflict will add some special characters into all conflicts as shown below
- Now add
git add
git commit
- This will open a vi editor Refer Here to learn about vi
-
In this
use esc+wq
-
Fastforward merge
- before merge
- after merge
- before merge
- rebase Refer Here
- before rebase
- after rebase
- before rebase
- cherry pick: Refer Here