how do I change the remote a git branch is tracking?
The 'central' repository had to be set up on a new server, so I created a new remote on my local repo, and pushed to that.
But now when I do 'git pull', it claims I am up to date. It's wrong -- it's telling me about the old remote branch, not the new one, which I know for a fact has new commits to fetch.
How do I change my local branch to track a different remote?
I can see this in the git config file but I don't want to mess things up.
remote = oldserver
merge = refs/heads/master
I have 3 local and 3 remote branches and want to be on the same branch on both. on local: git branch A * B master git branch -r origin/A origin/B origin/master on remote: git branch A B * master I a
Is there a way to write an alias that merges a branch back to its parent? I know I can do: git checkout - && git merge - But it only works in simple cases when my previous branch is the paren
Can someone explain a tracking branch as it applies to git? Here's the definition from git-scm.com: A 'tracking branch' in Git is a local branch that is connected to a remote branch. When you push
I am on a repo on github. I have one local branch called : master and on the remote repo there are two branches, branch1 and branch2. I cloned the repo from the branch1. But then, I wanted to pull bra
I'm usually tracking many remote branches. After I do a git fetch to get all the latest updates from all tracking branches. Is there a single command to see which remote branch I just fetched is ahea
I am trying to maintain a bare copy of a Git repository and having some issues keeping the remote tracking branches up to date. I create the remote tracking branches like this: git branch -t 0.1 origi
I was working on a feature branch and I did a git checkout -b feature/other-feature, did some work, committed it and then pushed it to origin feature/other-feature on github. When I created a pull req
In git, how can I checkout out the HEAD version of my remote/tracking branch? Basically, I want to do a 'svn checkout ' in git. I think the closest thing I find is 'git fetch', but from the man page,
When I create a new branch from a remote branch using EGit I get the wrong remote tracking set up: I create the local branch feature1 from the remote branch refs/heads/master and immediately push to u
Suppose that a remote repo remote has a branch spanking_new_branch that's not represented/referenced in any way in the local repository. I want to create a local branch that tracks remote/spanking_new
I'm testing out a package (git clone git://guacamole.git.sourceforge.net/gitroot/guacamole/guacamole) This project has two branches: 'master' and 'unstable' How can I get the 'unstable' branch ? Sorry
When I'm on master, I only have to type 'git push' to push commits to the remote repo. I wish I could do so when I'm on another branch, without specifying the remote name and the branch name. Like tha
I have a relatively large collection of remote branches from an old remote repo: $ git branch -r guy/feat1 guy/feat2 guy/feat3 guy/feat4 guy/feat5 guy/feat6 guy/feat7 guy/feat8 origin/HEAD origin/mast
I have a scenario in which there a several remote tracking branches within my local repository that I must sync up to. Our workflow model is: make a branch locally, based off of the desired remote tr
I have two directories on my local machine pointing to the same remote git repository. When I issue the command git branch -r in one of the directories I get a longer list of remote branches then in t
After creating a branch with --track (or leaving the default, or --notrack), you later wish to be reminded of what a branch is tracking. Is there a way, other than searching through the .git/config fi
After I have messed around with directories (created/removed) and added/edited both text and binary files, how do I tell git to throw away all my changes, and bring the branch down again, as if I neve
In my current repo I have the following output: $ git branch -a * master remotes/origin/master remotes/public/master I want to delete 'remotes/public/master' from the branch list: $ git branch -d rem
I just deleted the wrong branch with some experimental changes I need with git branch -D branchName. How do I recover the branch?
For remote branches that have been removed via git prune --all origin, how do you restore them? Assumption There are over 100 branches and shared by a team of 20 people and everyone is working on diff
I'm developing a git post-receive hook in Python. Data is supplied on stdin with lines similar to ef4d4037f8568e386629457d4d960915a85da2ae 61a4033ccf9159ae69f951f709d9c987d3c9f580 refs/heads/master T
I have a git repository which tracks an svn repository. I cloned it using --stdlayout. I created a new local branch via git checkout -b foobar Now I want this branch to end up in …/branches/foobar in
The usual command is: git checkout origin/branch_i_want -b branch_i_want Git responds with: Branch branch_i_want setup to track remote branch branch_i_want from origin. This is fine. My question is
I have a local repository cloned from a bare remote repository. The following command lists al the remote repository's branches. $ git ls-remote <remote> 74bd3eb190edb39db04f6c0c4dbbb9e1e96bc6db
This question already has an answer here: how do I get git to show me which branches are tracking what? 8 answers When I do 'git branch', I get * (no branch) and when I do 'git remote', I get
I'd like to grab a single branch (not all of them) of a remote repository and create a local tracking branch that can track further updates to that remote branch. The other branches in the remote repo
Hey I am working on a local branch on an Android Project.I want to replace all code on my local branch with all the code on the remote master.When I try to do git pull origin master,it tries to merge
we are using git in Team Foundation Service, and we are trying to find a way to delete a remote branch by running the following command. git push origin --delete TheBranchName The remote server keep
How do I delete a remote master branch from GitHub/Bitbucket? I'm trying: # git push bb --delete master remote: bb/acl: user is allowed. accepted payload.[K remote: error: refusing to delete the curre
In another question it was recommend that I try resetting a remote tracking branch to an earlier commit and performing an import a second time. I can't figure out how to do that! I can reset master, b
With Git I am on a branch. I am rebasing the branch atop master. There is a conflict that I want to resolve by ignoring the branches version and accepting master's version. How do I indicate I want to
I have a git repository fully tracking a remote SVN repo. Now I need to add a new branch that will be tracking a directory in a completely different SVN repo. Is that possible?
Is it possible to reset branch that is not currently checked out? I want to create a cron script that will perform git svn fetch and then update all local branches tracking svn remote branches with ne
Such as, I have deleted the patch-1 branch in github.com, and run git fetch origin to update local repo to track the remote, but the command git branch -a still show I local repo tracking remotes/orig
In my workplace, we just moved to Git for revision control after more than 10 years of using Source Safe (yay!). I now have to support our engineers in their learning of the new tool. It is important
My remote repo's master branch looks like this (each one is a commit): A - B - C - D - E - F - G I would like to get a code review that diffs C and G (C's changes from B should not be displayed). How
I made changes in my working directory and did a 'git commit' And then I do a 'git pull'. Git tries to pull changes in the remote tracking branch and automatically merge it for me. But there are some
Subtrees in Git work nicely although some git commands remain to be supported for subtrees. Here's the question: How to make the subtree pull from a different remote branch like stable or integra
When I try to create a new branch tracking a remote branch, I get this: che@nok ~/prj/git-ipc $ git branch -t test main/some_remote_branch error: Not tracking: ambiguous information for ref refs/remot
I'm using git-svn to track an svn repository with several branches. One of the server branches I've been working with has been renamed in the svn repository. Git-svn doesn't seem to understand what's
I'm trying to create a branch from a remote tag, but it seems there's no way to do it. When I try git checkout -b test origin/deploy where origin is the remote and deploy is the tag I want to check o
My problem is related to Fatal Git error when switching branch. I try to fetch a remote branch with the command git checkout -b local-name origin/remote-name but I get this error message: fatal: git
This question already has an answer here: Move the most recent commit(s) to a new branch with Git 7 answers In git, how do I remove a commit from one branch and apply it to a different branch?
For some reason, $ git status shows me changes to other directories: How do I instruct git to stop tracking outside directories?
I'm looking for a less rubbish way of doing this: git diff patch.DisableCreditCheck > ~/patch patch -p1 < ~/patch ie. The changes from a branch as raw uncommitted changes. The downside of patc
I was working with git and I don't know how this happened but by default I am seeing this as my master branch GIT Gui (C:/) C/ Can you help me in removing it to something else like C:/MyTestFolder .
I know that I can fetch any remote branch to any local branch, but is there also some kind of shortcut to fetch just from the tracked remote branch to the current tracking local branch (without the ne
If I remove a remote from my repo (suppose I delete the remote origin), is there a quick way to remove all of the remote tracking branches for that remote? I'm aware of git branch -dr, but I'd have to
I have a web-app deployed on heroku. In order to update the running instance, I must git push my code to the master branch of the heroku remote. I also keep my code on github, and have github as my or
When I clone a remote repository with git clone 'repo_url' git pull git status I get this message - On branch master Your branch and 'origin/master' have diverged, and have 41 and 20 different comm