Created
May 10, 2016 14:38
-
-
Save sourabh-upadhyay/c160144c5a34840bea41c994eb21c799 to your computer and use it in GitHub Desktop.
git custom script (command)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Open .bashrc file(/home/.bashrc) | |
2. syncBranchWithMaster() { | |
git checkout master; | |
git pull origin master; | |
git checkout $1; | |
git rebase master; | |
} | |
alias sync-master=syncBranchWithMaster | |
# USAGE : sync-master branc-to-sync | |
Put this code over there. | |
branc-to-sync is a branch name which needs to rebase with master. | |
Example: | |
You have 2 branches | |
1) new_branch | |
2) master | |
Now you need to rebase with master | |
$ sync-master new_branch | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment