git merge loses the branch reference
$ git pull
... time passes ...
$ git checkout topic # remote topic
$ git checkout master
$ git merge topic
$ git push
non-fast-forward updates were rejected
$ git pull
merge by rebase
$ git push
The result is that the file changes are pushed but the reference back to the topic branch has been lost. (On github, this results in a pull request not closing.) It also makes the graph look odd in that topic branch is not shown to be merged into master.
The trigger for causing this to happen is a pull after the merge that requires a merge. That is, master was changed during the topic merge.
The setting for pull is to always use pull --rebase.
As a further side affect a tag placed on the merge point was kind of lost. The tag was never pushed (although it was requested).
We were able to fix the graph by re-merging the topic branch.
How can we avoid this in the future? What is it that causes this problem? It doesn't feel like we've done anything incorrectly.
ps The config is set to only pull/push the current branch.
I am using git for my project and trying to follow best practice: I work on topic branch When ready, I merge the topic branch into my dev branch using git merge --squash. This keeps my dev branch cle
I have a repo online, that I no longer make use of the master branch, so I created a branch called dev-test and pushed all my local repo to this branch, but now in my VPS, I installed git and need the
This is not a duplicate of git pull from clean directory has merge conflicts - In that question the user was trying to pull from a remote which had commits which were not in the local branch. In my ca
Say you are in a branch topic, you have been working for a while and want to merge in some commits from master. You run git merge and there are a few conflicts. But you don't have time to resolve the
I have a buggy master branch that I need to debug. To do that, I want to insert a bunch of debug procedures (e.g., printing variables), pin point the bug and apply fixes. Later, I want to merge the fi
I want to merge a branch into another branch selectively & then merge another branch ignoring 1 branch in between. How do I do this with Git? I am using Git Extensions for visual studio.
I would like to ask about Git merging in the following scenario: branchA -*-*-*-*-* \ branchB *-*-*-* It is possible to do a git merge in this case an obtain the following result? branchA -*-*-*-*-*-
This is a newbie question. I have 2 branches, branch_A and branch_B. I am in branch A and do a merge with this command: git checkout branch_A git merge --commit -m my commit branch_B If there is no
I am confused with git merge. Suppose i have feature branch taken from master and they have divergedliek this and they merged like this Now i want to know that what will be the diagram after this com
I have a master and PersonalSite branch for a codebase I'm working on. I have been repeatedly trying to merge the master into the PersonalSite branch to no avail. This time, I thought I had everyth
I created a branch to try a different approach and it worked, so I would like to merge the Farmcrops branch into Master to keep those changes but continue the Farmcrops branch to explore another
I have a problem with a SVN branch. I made a checkout of it with git checkout -t -b stable svn/stable. Then I did a merge with git rebase master. After that I tried to commit the merge changes into th
How can I merge a state before wrong commits into the current head in Git? Mistakenly merge by a other person resetted my change on the server, after I fetched and merged the remote master branch, my
I have a branch that is currently at the same commit as master. Another developer has just merged master into their branch and resolved all conflicts, but they have NOT done the opposite yet: merge th
git checkout develop > Switched to branch develop git merge --no-ff master > Already up-to-date git checkout master > Switched to branch master git merge --no-ff develop > Already up-t
This question already has an answer here: How do I tell git to always select my local version for conflicted merges on a specific file? 1 answer I have two branches, A and B. Branch A have a di
I just made a huge commit to a newly created branch (created for this purpose), only to realize that I really want to merge this commit into master, rather than into the down-stream working branch I h
I'm merging changes from a stable branch back onto the development branch. I want it to be a real merge, by which I mean it should show a merge when I do git --graph --oneline. The catch is, I don't
I have 2 git branches branch1 and branch2 and I want to merge file.py in branch2 into file.py in branch1 and only that file. In essence I just want to work on the file.py in branch1 but want to take a
I have tons of data in directory called reports. While doing git merge with another branch I am getting lots of conflicts for files under reports directory. I would like git merge to ignore files unde
I'm using git flow for my project and I had to make a hotfix branch. When it was completed, I made a pull request to merge it into master and then deleted the branch. I've since realized that it also
I have 2 branches, develop and master. The master branch should not contain some development files and tools that are store in a directory called boilerplate. So far, so good, since I can more or less
I was trying to merge a dev branch into master. git checkout master git pull . dev Everything seemed to go well, although there were conflicts I fixed these and commited. But when I checked this newl
I was on the master branch, and I ran git checkout -b ui. Did tons of work over the course of a week, at the end of which I ran: git add . git commit -am 'ui' git checkout master git merge ui git push
I'm having a very weird problem with git, which I have not seen previously. I'm trying to do git merge --squash feature-branch, but there's a non-conflict in one of the files (there's no actual confli
I have two branches, master and dev. I always work on dev and only check code into the master branch once it's been approved for production use. When I do so, I have to do the following: git checkout
I've merged branch A with master and created branch B. However, I've since discovered that branch A has things that need doing. Is there a way of reverting to this earlier state? If branch B is lost i
Is there any git UI for managing just git branches, hidding commits? All currently available git clients show big log report with all commits in branches, so I might lost the focus of a branch that is
I get stumped when git diff other_branch shows differences and git merge other_branch does nothing. What's the right way to incorporate that missing code into my_branch? This SO answer diagramed a s
If I merge a git feature branch back onto master, is it best to then delete the branch? Let's say 6 months later, I want to resurrect that deleted branch (assume a freshly cloned repo). Is there a way
For example, I my master branch has stuff in it. Another branch called other_branch has stuff+more_stuff in it. Each branch has nothing to commit. If I checkout master then try to merge other_branch,
I'm in branch_X I do git log -p lib/foo to see differences in the file foo, but the interesting thing I want to see is just written as: commit aaaaaaaaaaaaaaaaaaaa Merge: bbbbbbbb cccccc Merge bran
Have a question on git merging, lets say I have 2 branches - B1 and B2, wherein B2 is created from B1. Development is going on parallel in both branches, as described below - commits 6, 7, 8 belongs
I have created 2 Git repositories (Dev and stagging) and branches b1, b2 and b3 in each of the repositories. Now how can I merge say b1 of Dev to b2 to Stagging? Is there anything that can be automate
What does happen if i do a git merge from another branch, some conflicts happen, the merge does not get commited, and then i do git reset --hard HEAD can i do the merge again? or will git believe tha
I have a git branch called 9-sign-in-out with the perfectly working code that I would like to become the master I'm currently on the master branch. $ git branch 9-sign-in-out * master I'm trying to
I have a develop branch and a feature branch in my git repo. I added a commit to develop and now I want that commit to be merged to my feature branch. If I do this git checkout feature git merge devel
I have a SVN repository which I checked out with git-svn, using the --stdlayout option (at that time, the repo was empty). I then worked on the master branch for a while. When using git svn dcommit, i
A colleague and I are using git with a single remote origin repository. We both Commit local then push to origin. As we are working there is naturally some divergence as especially my colleague doesn´
I'm trying to make sense of rebasing in Git and have a question whether or not it's good practice to use rebasing in this scenario: I have a branch called 'feature' which is branched off from another
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 a git repository with master and alt branches. alt branch contains modified version of master code, and i am trying to merge changes from master to alt like this: git merge --squash master Mer
We have a shared project that is referenced by multiple solutions. Our problem is that when merge from dev to main or release that shared project reference is still pointing to its dev branch. We'd li
I am a newbie in Git. I have the following setup. SETUP: master-branch: Main stable branch of my project. Actually, it contains the html code of my website. When I uploaded the files on the web, I did
How to merge a branch with git using patience option provided by the recursive strategy? I'm using git version 22.214.171.124.msysgit.0 Even docs are not consistent and, what's more, differ from what the act
If I merge branch a in b, after merging i have to push then branch for update the remote branch or merge updates remotes branch?
I have branch Master, branch A and branch B. Now I'm working in the branch A and I need to merge branch A with branch B and proceed my work in the branch A. All files are comitted in the branch A and
There're few question about flattening merge on StackOverflow, with an answer usually being git rebase. These answers though miss one crucial point - order of commits. Suppose there's a branch A w
We use GitFlow to manage our software repositories: http://nvie.com/posts/a-successful-git-branching-model/ I have a situation that I'm not sure how to handle in this branching model. I made about a d
I did the following to merge Git notes. ref : http://vmiklos.hu/blog/git-notes-merge I cloned a repo, added notes reference to the commit (refs/notes/commits). When i push it, central repo rejects it