Skip to content

Instantly share code, notes, and snippets.

@sutandang
Forked from hofnerb/remote_url.md
Created August 27, 2018 03:27
Show Gist options
  • Save sutandang/398788dad2f475867188410fcdac24e3 to your computer and use it in GitHub Desktop.
Save sutandang/398788dad2f475867188410fcdac24e3 to your computer and use it in GitHub Desktop.
git remote set-url

Review and Change Remote URL

git remote -v
# View existing remotes

git remote set-url origin https://github.com/user/repo2.git
# Change the 'origin' remote's URL

git remote -v
# Verify new remote URL

(Source: http://stackoverflow.com/a/19298943/2574238)

Check remote tracking repository

git branch -vv

Push local_branch to remote remote_branch, i.e., to a branch with a different name

## to set the pull
git push -u remote local_branch:remote_branch
## to set the default push
git config push.default upstream

(see http://stackoverflow.com/a/5739015/2574238 and http://stackoverflow.com/a/5740047/2574238)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment