Tag: merge

Git consistently merging one file incorrectly

I’m having a weird issue with git‘s merge feature that I’ve never seen before. I am merging some changes from a branch into master and git seems to be consistently having trouble with one particular file. It’s basically merging content into seemingly random places. It’s happened the last few times this file has been merged. […]

Reverting a revert of a merge with old branch ahead of master

This is my situation. On Branch X originally created from master (M) I did some commits. Then I opened a pull request and one colleague merged to master. Then, this colleague noticed some problems and created a branch RB on which he did a revert of the merge to master. In the meanwhile, I did […]

which way to git merge?

Let’s say that I want to do a non-fast-forward merge (a “real merge” and definitely not a rebase) of a branch featureBranch into a branch master. For the sake of simplicity please assume that there are no remote repositories (there is only 1 local repository), and this is the output of git checkout featureBranch && […]

Repeated conflicts on pull –rebase after got merge

Here is the scenario: I had created branch1 out of master some days back. Then, there were some pushes on branch1 and some pushes on master. I want to keep branch1 in daily sync with master so that when I merge branch1 into master finally, it already has those changes. So, I decide to merge […]

why does git give me a CONFLICT error when merging a branch that performed a rename?

I have 2 branches in git master breaking_changes On the breaking_changes branch I renamed a file from user/term_+_bash.sh to dev/gnome-term_+_bash+tmux.sh I also performed the same rename action (renamed the same file and gave it the same name), but independently on the master branch. I then tried to merge in the work from the master branch […]

Git merge to a old point in history

I have a small repository, which I try to keep the more linear as possible (only one main branch). At some point in time I introduced breaking change in my code, put a tag at that point and continue. Now, after a lot of commits and push and pull, I needed to extract some stuff […]

New branch from origin or unmerged branch when working on new JIRA?

Want to know the practice. Say there is an upstream and I forked from there. For each JIRA ticket I am going to work on, I will create a new local branch from my origin. Things are smooth when I finish the JIRA, I push the branch to my origin, create a pull request to […]

Is there a way to take all changes from one branch during merge conflict in git?

I am using git for version control and sourcetree as the GUI client. Recently I merged a branch into master branch and conflict occur. I am quite sure I want all changes from another branch during conflict. Do I have ways to take all changes from another branch instead of just resolve the conflicts one […]

Git – how to roll back after a mistakenly “merge”

I mistakenly merged one branch (a) to branch(b), now the files in a got deleted. I don’t have any tag for branch a, and made several commits previously. How to roll back or back the stage before the merge was made, so I can have my files back? I tried: git reset –soft HEAD~3 Seems […]

Retaining Git Commit History in commit message when Merging branches in Git

Is there a command or option in Git that I can use when merging one branch into another so that the entire commit history / the commits that are getting merged show up in the commit text. So that whenever I do a git log I can also see all the commits that were merged […]

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