Questions tagged [git-remote]

git-remote is a command used to manage the set of tracked remote repositories.

git-remote is a command used to manage the set of tracked remote repositories for a git repository. It allows to setup, remove and edit the set of repositories ("remotes") whose branches are tracked.

See the man page.

808 questions
17987
votes
39 answers

How do I delete a Git branch locally and remotely?

I want to delete a branch both locally and remotely. Failed Attempts to Delete a Remote Branch $ git branch -d remotes/origin/bugfix error: branch 'remotes/origin/bugfix' not found. $ git branch -d origin/bugfix error: branch 'origin/bugfix' not…
Matthew Rankin
  • 400,554
  • 38
  • 116
  • 156
4757
votes
15 answers

How do I push a new local branch to a remote Git repository and track it too?

I want to be able to do the following: Create a local branch based on some other (remote or local) branch (via git branch or git checkout -b) Push the local branch to the remote repository (publish), but make it trackable so git pull and git push…
Roni Yaniv
  • 49,329
  • 5
  • 17
  • 14
4535
votes
26 answers

How can I determine the URL that a local Git repository was originally cloned from?

I pulled a project from GitHub a few days ago. I've since discovered that there are several forks on GitHub, and I neglected to note which one I took originally. How can I determine which of those forks I pulled?
Tim
  • 45,633
  • 3
  • 17
  • 19
4498
votes
28 answers

How to change the URI (URL) for a remote Git repository?

I have a repo (origin) on a USB key that I cloned on my hard drive (local). I moved "origin" to a NAS and successfully tested cloning it from here. I would like to know if I can change the URI of "origin" in the settings of "local" so it will now…
e-satis
  • 515,820
  • 103
  • 283
  • 322
1029
votes
11 answers

How to remove remote origin from Git repo

I just did git init to initialize my folder as git repo and then added a remote repository using git remote add origin url. Now I want to remove this git remote add origin and add a new repository git remote add origin new-url. How can I do it?
Om3ga
  • 24,135
  • 40
  • 122
  • 201
952
votes
24 answers

Find out which remote branch a local branch is tracking

See also: How can I see which Git branches are tracking which remote / upstream branch? How can I find out which remote branch a local branch is tracking? Do I need to parse git config output, or is there a command that would do this for me?
readonly
  • 306,152
  • 101
  • 198
  • 201
589
votes
19 answers

Remote origin already exists on 'git push' to a new repository

I have my project on GitHub at some location, git@github.com:myname/oldrep.git. Now I want to push all my code to a new repository at some other location, git@github.com:newname/newrep.git. I used the command: git remote add origin…
uzumaki naruto
  • 6,149
  • 3
  • 15
  • 12
405
votes
3 answers

What does '--set-upstream' do?

What does git --set-upstream do? I tried to understand it by reading the git manual, but I didn't quite get it.
309
votes
3 answers

Git - What is the difference between push.default "matching" and "simple"

I have been using git for a while now, but I have never had to set up a new remote repo myself and I have been curious on doing so. I have been reading tutorials and I am confused on how to get "git push" to work. If I simply use git push it asks…
Josh
  • 3,513
  • 3
  • 17
  • 23
295
votes
6 answers

How to pull remote branch from somebody else's repo

I've got a project hosted on GitHub which somebody has forked. On their fork, they've created a new branch "foo" and made some changes. How do I pull their "foo" into a new branch also named "foo" in my repo? I understand they could submit a pull…
Colin O'Dell
  • 7,281
  • 8
  • 34
  • 72
276
votes
4 answers

How to add a local repo and treat it as a remote repo

I'm trying to make a local repo act as a remote with the name bak for another local repo on my PC, using the following: git remote add /home/sas/dev/apps/smx/repo/bak/ontologybackend/.git bak which gives this error: fatal:…
opensas
  • 52,870
  • 69
  • 227
  • 340
268
votes
13 answers

Changing the Git remote 'push to' default

I want to change the Git default remote branch destination so I could just git push Instead of: git push upstream Currently this is set to the origin remote and I want to set it to a different remote. I tried to remove the original (cloned from)…
alonisser
  • 10,004
  • 16
  • 71
  • 123
232
votes
13 answers

How can I find the location of origin/master in git, and how do I change it?

I'm a Git newbie. I recently moved a Rails project from Subversion to Git. I followed the tutorial here: http://www.simplisticcomplexity.com/2008/03/05/cleanly-migrate-your-subversion-repository-to-a-git-repository/ I am also using unfuddle.com to…
Brian Kelly
  • 5,398
  • 4
  • 24
  • 30
211
votes
7 answers

Git branching: master vs. origin/master vs. remotes/origin/master

I think I'm on the right track to understand the basic concepts of git. I've already set up and cloned a remote repository. I also created a server side empty repository, and linked my local repository to it. My problem is that I don't understand…
John Rumpel
  • 4,125
  • 4
  • 29
  • 43
192
votes
5 answers

How can I push a local Git branch to a remote with a different name easily?

I've been wondering if there's an easy way to push and pull a local branch with a remote branch with a different name without always specifying both names. For example: $ git clone myrepo.git $ git checkout -b newb $ ... $ git commit -m "Some…
jmacdonagh
  • 2,765
  • 3
  • 16
  • 13
1
2 3
53 54