Tag: git merge

Using git, how do a merge a tracked branch back into the remote origin/HEAD?

I got myself into a little bit of a local repo mess. Long story short, I had a copy of a remote repo; I created a branch called ‘my_branch’ in my local repo; I committed work a few times. I then just pushed the branch to the remote repo. Here’s my local repo diagram…(since I’ve […]

Revert merge without rebase

I realized that a branch was merged to my master branch which shouldn’t – commit is already pushed. The branch wasn’t rebased – it means i don’t see a one “merge commit” – the commits from the branch are in master branch now and i can’t tell which commits come from merging and which were […]

Git: forks with specific folder's content remaining different in each repo (not considered in merges)

I need two connected (forked) repositories to have a common folder whose contents are not considered when synchronizing the two repositories (both directions). In such a way where this requires no manual intervention when synchronizing to prevent accidental overwrites/merges/adds. More details: Consider repository A (private) and fork F (public). In each repository there is a […]

How to `git reset` After `git merge –no-commit –no-ff`

I am a newbie to git. I was working on a branch that involved lot of moving around of the code, including deletion of old and addition of new files. Therefore I decided to do a dry-run of git merge before actually merging: I ran git merge –no-commit –no-ff <myBranchName>. After I ran this, it […]

Merge a branch, but dont fill gitk with noise BUT dont lie about where it came from

Im’ probably doing this wrong or misunderstanding something here but basically I do not want to fill our master branch with noise but i do not want to lie about my history. So we have a master branch and a dev branch In this case we also have a feature branch full of both important […]

How to Git Merge while preserving changes in master?

I have wordpress theme, inside a git repo, which i modified to suit my needs. Now a version update of the theme has been released. I created a new branch for the theme update and committed the update there. Now I would like my changes in master branch to be preserved when merging. But how? […]

Is it true that `rebase' leads to a fewer number of conflicts than `merge'?

From time to time I stumble upon a statement that ‘git rebase‘ leads to a fewer number of conflicts than ‘git merge‘, for example here: Why does git rebase often have fewer merge conflicts than a merge?. Does it mean that there may be situations where git-merge <BRANCH_A> <BRANCH_B> would fail, I would do git […]

How to keep master history short and clear in git?

I have 2 remotes repository for a project. 1(origin) is my private repo where I make my modification to the project. 2(upstream) is the original github repo where I cloned(–bare) from. From time to time, I get updates from the upstream and merge it to master, and it works well. However when I see the […]

Force merge file by file – git

I have just merged two branches ‘branch1’ and ‘branch2’. The problem is that it is now a mess with a lot of conflicts, with sometimes duplicate contents (is it possible ??). What I want to do is to force for some files from ‘branch1’ to be merged against ‘branch2’ and conversely to force some files […]

Merge fast-fowards to another branch and no commit record is created

I have a master branch and debug branch. They are one commit apart. debug branch is branched from master and has one commit. When I merge them, git fast-fowards master branch to debug branch, not creating another commit as I am familiar. It is missing some information, namely comments, from the master branch (which becomes […]

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