git remote tracking branch pushes new branch
I'm having trouble understanding what I did wrong when pushing to a remote branch. Here is what I did:
I created a remote tracking branch locally named CP_Server_Release using the SourceTree GUI tool. This branch is set up to track the remote branch origin/ICN_Portal_Server_Release. I wanted a slightly shorter name for my local branch for convenience.
I made changes on CP_Server_Release and committed.
I then pushed my changes but I ended up creating a new branch called CP_Server_Release in the remote repo! This is not what I was expecting which was to push my changes into the ICN_Portal_Server_Release. So I figured something was wrong with the tracking set up.
I then deleted the new remote branch I created unintentionally and I ensured I was tracking the branch I want to by running the following:
moliveira-> git branch -u origin/ICN_Portal_Server_Release
Branch CP_Server_Release set up to track remote branch ICN_Portal_Server_Release from origin.
moliveira-> git status
# On branch CP_Server_Release
# Your branch is ahead of 'origin/ICN_Portal_Server_Release' by 1 commit.
# (use "git push" to publish your local commits)
nothing to commit, working directory clean
That looks right to me. I am ahead by one commit because last time I pushed a new branch instead of pushing my changes into origin/ICN_Portal_Server_Release. It also looks like I am tracking the correct remote branch.
So now I want to go ahead and push my changes to origin/ICN_Portal_Server_Release.
moliveira-> git push
Counting objects: 109, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (24/24), done.
Writing objects: 100% (30/30), 5.05 KiB | 0 bytes/s, done.
Total 30 (delta 10), reused 0 (delta 0)
* [new branch] CP_Server_Release -> CP_Server_Release
It created a new branch again!! I don't understand why. What am I doing wrong? The only thing I can think of is it may have something to do with me not being in the root directory of the repo (/icnportal_server) but instead in a subdirectory (src/main/java). If so, why is that?
Thanks for the help!
I have rebased a branch locally which was already pushed. Git is advising that my branch and remote have diverged and that: and have 109 and 73 different commits each, respectively Will pushing my b
How do I push changes from a local git branch to an existing non-master remote branch? If I do a git push, it tries to push changes in all local branches to the remotes they are tracking.
So I've gotten a project up on github and everything is dandy. Now I want to create a new branch. Here's what I've done: created a new local branch pushed the new branch to github Here's the problem
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,
You would think this would not be a common use case, but I create new git repos pretty frequently. Essentially, I have a shell script that stores the current branch into $CURRENT_BRANCH via: #!/bin/sh
When I git branch -a | grep my_funny_branch it gives remotes/origin/my_funny_branch But when I git branch -d -r origin/my_funny_branch it gives error: remote branch 'origin/my_funny_branch' not foun
This question may sound silly, and I am pretty much an amateur in git, but does the git merge or git pull command, creates a new branch when there are conflicts?
git-fetch manual page says: git fetch remote_repo will update remote-tracking branches of all branches from the remote repository. What if I only need fetch a single remote branch? I try to run: gi
When I execute git branch on the command line I get a list of all the branches on a repo, however when I execute $(git branch) in a sub-shell, it first prints out a list of files in the top level fold
This question already has an answer here: Force Git to overwrite local files on pull 25 answers I want to sync the local branch with the remote git branch. I tried to do git pull but it fails w
my current workflow to deploy code is to branch a releases branch from master when i believe the code is in a stable state. on my production side, i do a simple git fetch origin and than check out m
I am attempting to figure out which remote branch was most recently updated. Something like 'git show-ref' but in chronological order would be good enough. How do I go about doing this?
My situation is thus: I do work on two different machines, both of which track a repository (origin) cloned from another source (git.domain_name). One one machine, my_machine1, I've created a branch t
See also: how do I get git to show me which branches are tracking what? 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
This question already has an answer here: Move existing, uncommited work to a new branch in Git 1 answer Based on the git documentation, if I want to save my changes to a new branch the standar
I am new in git. I could not come back to master branch. I used several git bash command. I am mentioning all those with result below. $ git checkout master error:pathspec 'master' did not match any f
Usually, a local branch tracks a remote branch. The remote branch will be updated when pushing or pulling. But what is the purpose of letting a local branch track another local branch?
I have several old branches that have been merged to the master branch. I want to start fresh, i.e, I want to delete all the previous branches except the master branch. The master branch will be the
Im trying to delete a remote branch and it keeps on re-listing. I have tried 1) git branch -rd origin/legacy 2) git gc --prune=now 3) git branch -d -r origin/legacy 4) When i try git remote rm origin/
I am using Bonobo Git Server for hosting my remote git. Is it possible to lock some branches in a repository so that it is only commit-able by authorize people? Other people can create their own branc
i have really annoying problem, i deleted my former acount on heroku with all the apps, then i created a new one , i wanted to add remote branch to git and then the problems started. git remote -v her
When branch B does not exist locally, but is on the remote repo, git branch * A git branch -a * A remotes/origin/B How can i pull B to my local repo? Should i git checkout B first? Should i pull, wh
How does git submodule add -b work? After adding a submodule with a specific branch, a new cloned repo (after git submodule update --init) will be at a specific commit, not the branch itself (git stat
I have cloned a git repo locally. I have made a number of commits to master branch and not pushed into remote. In the meantime, others have added to the master of remote. Now I want to keep my commits
I am working with a remote git repo that does NOT support email notification upon commit. I am wondering if anyone know any means/tools to monitor and track the commit on one or more branches? Thanks
I have ready many articles about protecting remote branches... I however would like to capture in a git hook the following LOCAL repo command: git branch -d abranchthatshouldnotbedeleted I would like
Does anybody know the difference between these two commands to clone and track a remote branch? git checkout -b branch origin/branch git checkout --track origin/branch I think both keep track of the
I have cloned a git repository and I would like to switch to a particular branch from the following list (e.g. branch1, branch2, branch3) Should I have to say git fetch origin branch2? How do I know t
I have two branches: local branch (the one which I work with) remote branch (public, only well-tested commits go there) Recently I seriously messed up my local branch (guess every git-newbie has bee
I just deleted the wrong branch with some experimental changes I need with git branch -D branchName. How do I recover the branch?
Sometimes by mistake some of users tend to push their local branches to a remote repo creating a new branch on the remote repo. How can we disallow the users to create new branches on a remote repo bu
When I run git branch -a I get this: master origin remote upstream web_search remotes/origin/HEAD -> origin/master remotes/origin/ba remotes/origin/insur remotes/origin/master remotes/origin/mv re
Problem: Need to push the changes from local git branch to a different remote git repository branch and this changes pushed to the branch will be compared with the master existing in the remote URL an
I did this: git fetch --all Fetching origin remote: Counting objects: 242, done. ............ From bitbucket.org:xxx/xxx xxxx..xxxx develop -> origin/develop * [new branch] branch1 -> origin/bra
What is the most concise and clean way of creating the following: Duplicate existing master branch to a remote 'experiments' branch? Setup remote to follow this new 'experiments' branch. Setup loca
Today I try to track a remote branch (specifically, Mapbox-ios-sdk's 23-callouts. So, what's the difference between the following three commands: git checkout remotes/origin/23-callouts git checkout -
I've checked the remote branch Design0.5: the last remote commit on that branch is identical to the top local commit, here marked (no branch). So locally, Design0.5 is 5 commits behind where I'd like
I'm not sure how this happened, but recently I noticed a strange remote branch that shows up when i run the command git branch -a remotes/origin/pr/121 remotes/origin/pr/122 remotes/origin/pr/126 how
I created a branch, say dev which was based off say branch Base and then merged it with Upstream content (I want to keep Base clean till I am done with my testing). After resolving conflicts, I ra
I would like to know, if it possible to find out who has pushed a new branch into a remote repository on GitHub? The problem is that the branch was created by checking out from existing master branch'
I have a branch called develop in my local repo, and I want to make sure that when I push it to origin it's merged with the origin/master. Currently, when I push it's added to a remote develop branch.
Let's say if I did a git checkout -b bar foo or git checkout foo git branch bar both should have created a branch bar base on the branch foo. But let's say the next day, if I want to verify that bar
TLDR: If X exists as a remote branch, then git checkout X should create a local branch of it. In my case, for a single branch, it does not. The remote repository has a master, release, and some other
I have setup my local branch to track remote branch. when I do git pull, it said 'Already up-to-date'. But when I do git log, the latest checkin is on Dec 21, 2012'. And when I do git log remotes/bran
I set up a ssh key on the machine, cloned a branch on my local machine then tried to delete its associated branch on the remote. Below are my step. Delete the local branch using git branch -D abc-123
How can I create a local branch that tracks a remote branch with libgit2sharp? The git equivalent would be: git branch --track development origin/development
Most examples of creating remote branches involve pushing from a local branch Is there a way of creating an empty remote branch without pushing? Is it also possible to create a local empty branch,chec
Let's say I have an Eclipse Project which uses versioning control with EGit and is connected with a remote repository email@example.com:git2013. In my project, under the local branch newstuff, I create a
I've cloned repository A's master branch from git and created my own branch called Li. I've made some changes a while ago and pushed the contents of local Li to remote Li. Now I've pulled some updates
I want to switch to the remote branch in Git. What is the difference these commands? git checkout -b feature1 origin/feature1 and git checkout --track origin/feature1