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

Re: How to ignore changes on remote

From
Scott Chacon <schacon@gmail.com>
Date
Mar 23, 2010, 16:05 UTC
Message-ID
<d411cc4a1003230905y12839743x400333a0aa2e7018@mail.gmail.com>
In-Reply-To
<1269354326.14299.7.camel@kheops>

Why would we teach someone to do that instead of just recommending the far less obscure 'git push -f'? A leading '+' on the refspec is ridiculously confusing compared to "just tell it to force the push with -f". Am I forgetting something?

Also, Howard, what do you mean by "I forgot to merge"? Do other people have push access to this branch? You can't just tell people "use the local version" after you force a push. If anyone has based work off of that point, you're going to get into way more trouble forcing a non-ff push than if you just did a merge and then resolved all the conflicts as --ours.

Scott
On Tue, Mar 23, 2010 at 7:25 AM, Sylvain Rabot <sylvain@abstraction.fr> wrote:
Show 27 quoted lines
> On Tue, 2010-03-23 at 14:13 +0000, Howard Miller wrote:
>> >
>> > git push origin +local_branch:remote_branch
>> >
>>
>> Thanks!
>>
>> Tell me more about that '+'. I've never heard of it before. Can't see
>> anything in the docs (although I'm probably not looking in the right
>> place)
>
> http://kernel.org/pub/software/scm/git/docs/git-push.html
>
> the '+' means that you want to bypass the security which does not allow
> non fast-forward pushes.
>
> Note that you shouldn't do non fast-forward pushes to a repository which
> can be cloned by other people than you. Once published (accessible to
> anybody) you should do a merge and then push to origin even if you only
> take your local history in the merge to avoid user pulling from origin
> conflicts due to the non fast forward history.
>
> Regards.
>
> --
> Sylvain Rabot <sylvain@abstraction.fr>
>
Previous: Sylvain RabotNext: Howard Miller
Message 8 of 14 in “How to ignore changes on remote”
  1. Howard MillerMar 23, 2010
  2. Sylvain RabotMar 23, 2010
  3. Howard MillerMar 23, 2010
  4. Alexander IljinMar 23, 2010
  5. Santi BéjarMar 23, 2010
  6. Howard MillerMar 23, 2010
  7. Sylvain RabotMar 23, 2010
  8. Scott ChaconMar 23, 2010
  9. Howard MillerMar 23, 2010
  10. Johannes SixtMar 23, 2010
  11. Johan HerlandMar 23, 2010
  12. Jakub NarebskiMar 23, 2010
  13. Johan HerlandMar 23, 2010
  14. Junio C HamanoMar 23, 2010

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.