Skip to content

Instantly share code, notes, and snippets.

@tadakoglu
Forked from hofnerb/remote_url.md
Created April 3, 2019 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadakoglu/d59701003349be2d602e32fbb4bf4749 to your computer and use it in GitHub Desktop.
Save tadakoglu/d59701003349be2d602e32fbb4bf4749 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