Tag: git merge

How to squash my git branch commits into the same branch without rebasing?

I have a local branch, we’re using git-flow with Pull Requests and I’m looking to squash a few commits after receiving PR feedback. How can I squash all my commits (from PR’s for example) into the same branch? I imagine it would be something like: git checkout master # For master git pull # Get […]

Git: How do I merge complex branches that have widely diverged with some missing history?

I have two “branches”, both of which started from the same code base, but both of which were imported to git after they diverged. The prior history is lost, and additionally both branches have extensive changes recorded in their git history. What is a good strategy to approach merging features and bugfixes between these two […]

Bitbucket: Conflict in remote repo, can't figure out how to resolve

I hope I can express this properly… I have the following setup in Bitbucket (using Git protocol). I have a master repo that contains my application. I then fork the master repo per client in order to have the flexibility to make client specific changes without affecting the master. When a generic change is required, […]

Why is the Git feature branch still visible after merge and deletion?

Steps taken I merged a feature branch back into master and deleted the feature branch. But it still shows up in the tree. Result Tree visualisation in SourceTree before deleting the feature branch: Tree visualisation in SourceTree after deleting the feature branch: The feature branch in the left-hand list is gone, as expected, and the […]

how does git check if a merge is needed?

According to documentation, git update-index –refresh does this: Looks at the current index and checks to see if merges or updates are needed by checking stat() information. What does it mean that git “checks to see if merges or updates are needed”? Does git keep an arbitrary flag somewhere saying “mergeme” after certain operations? Also, […]

How to nest git repositories; fetch and merge

So I have two git repos. The first is our framework (think db abstraction, functions) and then another git repo for our new project. I want to include the framework git repo into the project git, and according to GitHub Help, this should work: cd /project git remote add framework git://github.com/username/Framework.git git fetch framework git […]

Git merge single file without rebasing

I have three branches (let’s call them master, testing, and feature). All three are shared, so I cannot rebase any of them without causing problems for others. Currently, all three branches have diverged (none is a fast-forward), so eventually some merging will need to done, since rebasing is not an option. For the moment, though, […]

How Do You Get the bufspec While Using Vimdiff Through Git

I’ve read Vimdiff and Viewing differences with Vimdiff plus doing various google searches using things like “vimdiff multiple”, “vimdiff git“, “vimdiff commands” etc. When using do or diffg I get the error “More than two buffers in diff mode, don’t know which one to use”. When using diffg v:fname_in I get “No matching buffer for […]

git union merge brings back some deleted lines

I’m trying to make sense of a puzzling behavior with git union merge. To repro, start with a hello.txt that has: 1 2 3 In another commit, add a line, e.g. 1 2 new 3 In a different foo branch off of the original commit, delete the middle line: 1 3 Here I would expect […]

Removing files from repository while merging makes them disappear

Here is a test repo demonstrating the problem: https://bitbucket.org/vektor330/bugtest The sequence of events is this: Add some initial commit. Person A adds Conflict and source to develop. Person B adds Conflict to master. Person B merges develop into master, resolving conflict on Conflict using “mine” strategy, and removing source from the repository. This is now […]

Git Baby is a git and github fan, let's start git clone.