EN
Git - most useful commands for git repo origin management - set remote url / add remote repo / remove / check / https ssh
6
points
Examples:
# check
$ git remote -v
> origin https://github.com/USERNAME/REPOSITORY.git (fetch)
> origin https://github.com/USERNAME/REPOSITORY.git (push)
# add
$ git remote add origin https://github.com/USERNAME/REPOSITORY.git
# set
$ git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
# remove
$ git remote remove origin
# push
git push origin master
It also works for SSH
# check
$ git remote -v
> origin git@github.com:USERNAME/REPOSITORY.git (fetch)
> origin git@github.com:USERNAME/REPOSITORY.git (push)
# add
$ git remote add origin git@github.com:USERNAME/REPOSITORY.git
# set
$ git remote set-url origin git@github.com:USERNAME/REPOSITORY.git
# remove
$ git remote remove origin
Git FIX for: There is no tracking information for the current branch. Please specify which branch you want to merge with.
After add or set url we can have a problem:
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> master
Solution:
git pull origin master
Second solution:
git branch --set-upstream-to=origin/master master
git pull
Useful links: