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.

930 questions
20257
votes
41 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
  • 457,139
  • 39
  • 126
  • 163
6037
votes
34 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…
Bite code
  • 578,959
  • 113
  • 301
  • 329
5550
votes
18 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
  • 57,651
  • 5
  • 19
  • 16
5310
votes
27 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
  • 53,399
  • 3
  • 19
  • 19
1448
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
  • 30,465
  • 43
  • 141
  • 221
1208
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
  • 343,444
  • 107
  • 203
  • 205
672
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,979
  • 3
  • 18
  • 12
543
votes
6 answers

When doing a 'git push', 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.
390
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
  • 8,386
  • 8
  • 38
  • 75
345
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
  • 11,542
  • 21
  • 85
  • 139
343
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
  • 60,462
  • 79
  • 252
  • 386
334
votes
17 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
  • 4,425
  • 2
  • 23
  • 12
323
votes
4 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,673
  • 3
  • 20
  • 27
282
votes
10 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,851
  • 3
  • 18
  • 14
236
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,564
  • 4
  • 27
  • 31
1
2 3
61 62