Tag: git merge

Merging branches but leaving out certain files

At our company we have alpha and beta, when we are about to release a new version we do a git merge alpha (while on beta branch), so we merge all alpha into beta. The problem with this approach is that we have some config files that shouldn’t be merged into beta, that are alpha […]

How to induce a `<<<<<`/`>>>>>` merging state in Git?

I have an old stash of working tree that is now some dozens of commits old. This stash nevertheless still represents useful work on a feature I need to bring forth. I abandoned it prior as I had to switch to a higher-priority feature since, stashing the former. Now, as always, my master represents current […]

Viewing changes to deleted files in git

Let’s say that when I branch off from master, there’s a file colors.txt on the master branch of my repo with these contents: red green blue yellow I then branch off into my-branch, in which I make the following changes: Delete colors.txt Add red.txt with these contents: red Add green.txt with these contents: green Add […]

GitLab – ignore specific files in target branch

I am using GitLab in my project and I have a quite specific workflow. I have 2 branches “Dev” and “Release” as shown below. When I submit a merge request from Dev to Release, the config files are also getting overwritten with that of Dev branch. But ideally config files have to be different for […]

Git – Cherry picking with ours/theirs strategy

I wonder if there is any way of cherry picking with ours/theirs strategy. On other words, I want to cherry pick multiple commits from dev branch into main branch with below commands, git cherry-pick HASH1 HASH2 HASH3 -n This command is supposed to take all referred commits and prepare unstaged changes if no conflicts. However, […]

Git creates a merge commit although it performs a fast-forward merge

I’m merging a hotfix branch into master. When I do a simple git merge hotfix-2.09 the merge fast-forwards but I’m getting a ‘merge branch “hotfix-2.09″‘ commit in the log. hotfixes 01 – 08 did not do this. Am I doing something wrong with this merge or did the state of my master change some how? […]

How to avoid merge conflits with multiple branch merges?

I am working on a web application with a medium sized team. We are versioning/collectively coding this project using Git. Between my co-worker and myself, I think we are about to run into a difficult merge, and I’d like to see if there’s anything we can do better before we run into trouble. We are […]

Merge commit without parent

Let’s say I have the following commits in my master: master : —A—-B—-C—-D—E Now I need to create new branch from commit A and include only changes in commit C master : —A—-B—-C—-D—E \ branch2 : \——-C So I need to put in my branch2 commit C without B How can I do that ?

No-FF for merges from a long time ago

In our Git repository we have a few merges from branches that should have been merged with –no-ff but were not. These merges were made a long time ago. Is there any way to force/insert a commit as if we were running those old merges with the –no-ff argument? One of the supers on the […]

Evaluating git and merge doesn't seem to work the way I expected

I’m trying to evaluate if moving to git from svn would be a viable option. I’ve heard that the merge in git works much better than the one in svn, but in my testing I haven’t seen that. Here’s what I’ve done: Created a file called main.c #include <stdio.h> function main() { int myNum = […]

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