Questions tagged [fast-forward]

Fast-forward term refer to DVCS merge technique.

When new branch changes merged to original branch which have no new changes since new branch created it moved to the top of original branch without merge commit. So resulted changeset history stay as linear history.

Git and Mercurial by default have such behavior. Bazaar instead use non-fast-forward merge technique.

110 questions
1313
votes
9 answers

What effect does the `--no-ff` flag have for `git merge`?

Using gitk log, I could not spot a difference between the effect of git merge and git merge --no-ff. How can I observe the difference (with a git command or some tool)?
user1162226
  • 13,223
  • 3
  • 14
  • 8
1195
votes
33 answers

How can I deal with this Git warning? "Pulling without specifying how to reconcile divergent branches is discouraged"

After a git pull origin master, I get the following message: warning: Pulling without specifying how to reconcile divergent branches is discouraged. You can squelch this message by running one of the following commands sometime before your next…
Davide Casiraghi
  • 15,591
  • 9
  • 34
  • 56
669
votes
2 answers

Why does git perform fast-forward merges by default?

Coming from mercurial, I use branches to organize features. Naturally, I want to see this work-flow in my history as well. I started my new project using git and finished my first feature. When merging the feature, I realized git uses fast-forward,…
Florian Pilz
  • 8,002
  • 4
  • 22
  • 30
292
votes
5 answers

Can I make fast forwarding be off by default in git?

I can't really ever think of a time when I would use git merge rather than git rebase and not want to have a commit show up. Is there any way to configure git to have fast forwarding off by default? The fact that there's an --ff option would seem…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
155
votes
3 answers

Prevent commits in master branch

(For simplicity) I have a master branch and a dev in my Git repository. I want to ensure the master branch is always working, so all work I do should be in the dev branch. However, when I merge my changes in with a --no-ff merge, I tend to stay in…
Rasmus Bækgaard
  • 1,748
  • 2
  • 10
  • 13
103
votes
6 answers

How to do a fast-forward merge on GitHub?

So one of my colleagues attempted to merge a branch using GitHub's "merge via fast-forward" option in the web-interface, to keep the history clean from bogus merge commits (the master branch into which they merged, had not progressed since the to-be…
umläute
  • 28,885
  • 9
  • 68
  • 122
81
votes
1 answer

What are the differences between `--squash` and `--no-ff --no-commit`?

Which one should one use to hide microcommits? Is the only difference between git merge --squash and git merge --no-ff --no-commit the denial of the other parents?
Tobias Kienzler
  • 25,759
  • 22
  • 127
  • 221
72
votes
3 answers

When to use the '--no-ff' merge option in Git

A Successful Git Branching Model recommends to use --no-ff when merging branches: The --no-ff flag causes the merge to always create a new commit object, even if the merge could be performed with a fast-forward. This avoids losing information…
leifericf
  • 2,324
  • 3
  • 26
  • 37
20
votes
2 answers

Undo git fast forward merge

I have this situation : Working on some testBranch for some time and I wanted to sync with master so I did git checkout testBranch and git merge master/testBranch So now my branch is synced with master but then I found out that I want to undo that…
Ivan Longin
  • 3,207
  • 4
  • 33
  • 42
19
votes
2 answers

Git Merge Fast-Forward vs Git Rebase

What is the difference between a fast-forwarded git merge and a git rebase? Don't both accomplish keeping history linear and no merge commits? If so, why would one use one over the other? If not, which is what I think is true, what is the whole…
Newo
  • 315
  • 1
  • 3
  • 9
17
votes
3 answers

How can I fast-forward a single git commit, programmatically?

I periodically get message from git that look like this: Your branch is behind the tracked remote branch 'local-master/master' by 3 commits, and can be fast-forwarded. I would like to be able to write commands in a shell script that can do the…
Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533
16
votes
2 answers

git fast-forward one commit

* 9dbd857 (hotfix-correct-java-jdk-path, feature/add-ansible-galaxy-requirements-file) requirements.yml: adds maven and nodejs requirements * 1643619 (QOL-1640-enable-vpc-peering) roles/ansible-linux-commons: change value of hostname in cloud-init *…
Felipe Alvarez
  • 3,720
  • 2
  • 33
  • 42
14
votes
2 answers

What does Fast-forward mean when pulling from remote?

I run git pull twice and get the following out: $ git pull remote: Counting objects: 1, done. remote: Total 1 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (1/1), done. From git.assembla.com:my-project da3f54c..bb335a4 master ->…
abg
  • 2,002
  • 7
  • 39
  • 63
13
votes
4 answers

Determine if a merge will resolve via fast-forward

I want to know if a particular merge will resolve via "fast-forward" or not before running the merge command. I know I can specifically request for the merge to not be resolved via "fast-forward" (using the --no-ff option). Or that I can try to…
uayebforever
  • 673
  • 8
  • 12
11
votes
1 answer

Git fast forward merge: Any chance to find the person to blame?

Suppose there is a feature branch 'my-feature'. While I was developing the feature, somebody merged it from 'my-feature' into 'master'. Because it was a fast-forward merge, no commit was made. Some of the changes made by me weren't ready for master…
digory doo
  • 1,978
  • 2
  • 23
  • 37
1
2 3 4 5 6 7 8