git/list[1] front-page[2] threads[3] people[4] search[5] about
 

On using receive.denyNonFastForwards and advice.pushNonFastForward

From
HWHilco Wijbenga <hilco.wijbenga@gmail.com>
Date
Jul 8, 2012, 21:26 UTC
Message-ID
<CAE1pOi1M-fdMJtZw9MNL2R6zWvpXvWVo4ros_NSCQtLmQb6TOQ@mail.gmail.com>
Hi all,

I was wondering how hard it would be to make "git push" more adamant about not pushing non-ff updates. So I wanted to see the effects of receive.denyNonFastForwards and advice.pushNonFastForward. (By the way, why is one plural and the other singular? That doesn't seem consistent?)

HERE=$(pwd) && git init --bare remote-repo && cd remote-repo/ && git config --add receive.denyNonFastForwards true && cd .. && git clone file://$HERE/remote-repo local-repo && cd local-repo/ && git config --add advice.pushNonFastForward true && echo "1" > one.txt && git add -A . && git commit -m 1 && git push origin master && git checkout -b next && echo "a" > two.txt && git add -A . && git commit -m 2 && git checkout master && echo "2" > one.txt && git add -A . && git commit -m 3 && git push origin master && git merge next && git push

To my surprise there was neither warning nor error. Does this last push really qualify as a FF update? Apparently, linear history and FF-only updates are not the same thing?

Cheers, Hilco

Next: Christopher Tiwald
Message 1 of 3 in “On using receive.denyNonFastForwards and advice.pushNonFastForward”
  1. Hilco WijbengaJul 8, 2012
  2. Christopher TiwaldJul 9, 2012
  3. Matthieu MoyJul 9, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.