Last active
December 5, 2018 16:31
-
-
Save metinsenturk/ed37f8f74307c9df48b002e93df292e9 to your computer and use it in GitHub Desktop.
Git replacing origin master with local master
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
#!/bin/bash | |
# replace origin/master branch with a local branch named as 'otherbranch', with force. | |
git push origin otherbranch:master -f | |
# list remote branch | |
git remote -v | |
# replace remote branch with another remote branch | |
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git | |
# push the branch to remote | |
git push origin BRANCH | |
# set branch upstream on remote | |
git branch --set-upstream-to=origin/BRANCH BRANCH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment