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

Re: Use "git pull --ff-only" by default?

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
May 21, 2010, 13:49 UTC
Message-ID
<4BF68F5F.9010309@drmicha.warpmail.net>
In-Reply-To
<A612847CFE53224C91B23E3A5B48BAC74483234E90@xmail3.se.axis.com>
Peter Kjellerstedt venit, vidit, dixit 21.05.2010 14:59:
Show 18 quoted lines
> Is there some way to make "git pull --ff-only" be the default?
> I could not find anything about this in "git config --help" and
> also the lack of a --no-ff-only option for git pull (it exists 
> for git merge) indicates that there is no such support.
> 
> I did considered the branch.<name>.mergeoptions configuration
> option, but it does not seem appropriate as it only applies to
> a specific branch, whereas I want it to apply to all branches
> by default.
> 
> Yes, I know I could do "git config alias.pl 'pull --ff-only'",
> but since my intensions are for this to be the default for all
> developers in our organization (most of whom have no git knowledge
> at all yet) to avoid unnecessary branches caused by the developers 
> hacking directly on master rather than a topic branch, I would 
> very much prefer a configuration option rather than an alias (as 
> I am unlikely to get the developers to remember to do "git pl" 
> instead of "git pull").

Problem is they have to remember to set your new config, or, if you are able to set all developers system config, they have to refrain from overriding it.

Show 7 quoted lines
> My idea was to add something like merge.options and pull.options
> as configuration options (I want to be able to specify the options
> separately for pull and merge). However, I wanted throw this out
> here first before starting to hack away at the code, in case I
> missed something obvious, or if others find this to be an
> incredibly stupid idea...
> 

In general, you can't control reliably what people do in their repos. But you can control what kind of pushes into a central repo you allow. That is the usual approach: Let them mess up their repos, they'll learn their lesson when they can't push ;)

Michael
Previous: Ævar Arnfjörð BjarmasonNext: Peter Kjellerstedt
Message 3 of 13 in “Use "git pull --ff-only" by default?”
  1. Peter KjellerstedtMay 21, 2010
  2. Ævar Arnfjörð BjarmasonMay 21, 2010
  3. Michael J GruberMay 21, 2010
  4. Peter KjellerstedtMay 21, 2010
  5. Michael J GruberMay 21, 2010
  6. Jay SoffianMay 21, 2010
  7. Michael J GruberMay 22, 2010
  8. Peter KjellerstedtMay 24, 2010
  9. Dmitry PotapovMay 24, 2010
  10. Peter KjellerstedtMay 25, 2010
  11. Dmitry PotapovMay 27, 2010
  12. Peter KreftingMay 21, 2010
  13. MonsignorApr 29, 2016

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.