Languages
[Edit]
EN

Git - most useful commands for git repo origin management - set remote url / add remote repo / remove / check / https ssh

6 points
Created by:
daniell
490

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:

Alternative titles

  1. git show remote repo
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join