Tag: merge

In git, what is the difference between merge –squash and rebase?

I’m new to git and I’m trying to understand the difference between a squash and a rebase. As I understand it you perform a squash when doing a rebase.

Git: ignore some files during a merge (keep some files restricted to one branch)

I have two branches, A and B. Branch A have a directory examples with some files that are tracked by git, and these files should not appear on branch B. In my workflow, I do merge changes made in A into B often, which is a problem every time that there is some changes on […]

When would you use the different git merge strategies?

From the man page on git–merge, there are a number of merge strategies you can use. resolve – This can only resolve two heads (i.e. the current branch and another branch you pulled from) using 3-way merge algorithm. It tries to carefully detect criss-cross merge ambiguities and is considered generally safe and fast. recursive – […]

Merging: Hg/Git vs. SVN

I often read that Hg (and Git and…) are better at merging than SVN but I have never seen practical examples of where Hg/Git can merge something where SVN fails (or where SVN needs manual intervention). Could you post a few step-by-step lists of branch/modify/commit/…-operations that show where SVN would fail while Hg/Git happily moves […]

Git Cherry-pick vs Merge Workflow

Assuming I am the maintainer of a repo, and I want to pull in changes from a contributor, there are a few possible workflows: I cherry-pick each commit from the remote (in order). In this case git records the commit as unrelated to the remote branch. I merge the branch, pulling in all changes, and […]

How to replace master branch in git, entirely, from another branch?

Possible Duplicate: Change the current branch to master in git I have two branches in my git repo: master seotweaks (created originally from master) I created seotweaks with the intention of quickly merging it back into master, however that was 3 months ago and the code in this branch is 13 versions ahead of master, […]

How to merge a specific commit in Git

I have forked a branch from a repository in GitHub and committed something specific to me. Now I found the original repository had a good feature which was at HEAD. I want to merge it only without previous commits. What I should do? I have known how to merge all commits: git branch -b a-good-feature […]

How to import existing Git repository into another?

I have a Git repository in a folder called XXX, and I have second Git repository called YYY. I want to import the XXX repository into the YYY repository as a subdirectory named ZZZ and add all XXX‘s change history to YYY. Folder structure before: XXX |- .git |- (project files) YYY |- .git |- […]

Git – how to force merge conflict and manual merge on selected file

We maintain web application which has common master branch and many parallel branches, one for each installation, each have few specific changes. Source code is managed in git and it is terrific tool when we need transfer features and bugfixes from master branch into parallel ones. But are few files that are sensitive and automatic […]

git cherry-pick says “…38c74d is a merge but no -m option was given”

I made some changes in my master branch and want to bring those upstream. when I cherry-pick the following commits however I get stuck on fd9f578 where git says: $ git cherry-pick fd9f578 fatal: Commit fd9f57850f6b94b7906e5bbe51a0d75bf638c74d is a merge but no -m option was given. What is git trying to tell me and is cherry-pick […]

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