Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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)

@tojacob

This comment has been minimized.

Copy link

@tojacob tojacob commented Oct 4, 2018

Thanks!

@whalemare

This comment has been minimized.

Copy link

@whalemare whalemare commented Apr 15, 2019

If you get fatal: No such remote 'origin' error, after git remote set-url origin command, try another one instead:

git remote add origin

@ykavi

This comment has been minimized.

Copy link

@ykavi ykavi commented Apr 21, 2019

<3

@Alimjanov-Ibragim

This comment has been minimized.

Copy link

@Alimjanov-Ibragim Alimjanov-Ibragim commented May 31, 2019

If you get fatal: No such remote 'origin' error, after git remote set-url origin command, try another one instead:

git remote add origin

Thanks

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