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.

900 questions
19556
votes
42 answers

How do I delete a Git branch 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 found. $ git branch -rd origin/bugfix Deleted remote…
Matthew Rankin
  • 439,004
  • 38
  • 121
  • 160
5538
votes
31 answers

How do I 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
  • 559,793
  • 108
  • 291
  • 328
5295
votes
17 answers

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

How do I: Create a local branch from another branch (via git branch or git checkout -b). Push the local branch to the remote repository (i.e. publish), but make it trackable so that git pull and git push will work.
Roni Yaniv
  • 54,946
  • 5
  • 18
  • 16
5063
votes
26 answers

How to determine the URL that a local Git repository was originally cloned from

I pulled a project with several forks on GitHub, but forgot which fork it was. How do I determine which fork I pulled?
Tim
  • 50,921
  • 3
  • 19
  • 19
1273
votes
16 answers

How to remove remote origin from a Git repository

I just did git init to initialize my folder as Git repository 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…
Om3ga
  • 27,889
  • 42
  • 136
  • 212
1104
votes
25 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
  • 331,320
  • 107
  • 203
  • 204
651
votes
22 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,769
  • 3
  • 17
  • 12
496
votes
6 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.
349
votes
7 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,907
  • 8
  • 39
  • 74
325
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
  • 57,792
  • 74
  • 241
  • 366
319
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,623
  • 3
  • 19
  • 26
311
votes
14 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,854
  • 19
  • 81
  • 133
293
votes
12 answers

How to handle git gc fatal: bad object refs/remotes/origin/HEAD error?

I randomly hit this today while trying to run Git garbage collect: $ git gc fatal: bad object refs/remotes/origin/HEAD error: failed to run repack How do I deal with this?
Ryan
  • 3,805
  • 2
  • 19
  • 11
249
votes
8 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
  • 3,441
  • 3
  • 17
  • 14
233
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,482
  • 4
  • 27
  • 30
1
2 3
59 60