Skip to content

Instantly share code, notes, and snippets.

@sourabh-upadhyay
Created May 10, 2016 14:38
Show Gist options
  • Save sourabh-upadhyay/c160144c5a34840bea41c994eb21c799 to your computer and use it in GitHub Desktop.
Save sourabh-upadhyay/c160144c5a34840bea41c994eb21c799 to your computer and use it in GitHub Desktop.
git custom script (command)
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