Last active
September 15, 2016 09:11
-
-
Save dilkhush/27af19c7c7faee7f609a to your computer and use it in GitHub Desktop.
Working with multiple branches taking pull and push with current branch
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
While working with multiple branches we need to type the branch name all the time while pull and push the data | |
below are two small script that can help you with that | |
---- push.sh | |
BRANCH=$(git branch | grep ^* | sed 's/* //' ) | |
echo $BRANCH | |
git push origin $BRANCH | |
----pull.sh | |
BRANCH=$(git branch | grep ^* | sed 's/* //' ) | |
echo $BRANCH | |
git pull origin $BRANCH | |
when you want to take pull just run | |
$ sh pull.sh | |
when you want to take push just run | |
$ sh push.sh | |
It will find the current branch for you and will perform the action |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment