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

Re: Files different for me

From
Brian Gernhardt <benji@silverinsanity.com>
Date
Feb 25, 2009, 18:38 UTC
Message-ID
<013B8F55-FBCC-4D3B-9EA4-13C05FFE986B@silverinsanity.com>
In-Reply-To
<450196A1AAAE4B42A00A8B27A59278E709E0486D@EXCHANGE.trad.tradestation.com>
On Feb 25, 2009, at 1:02 PM, John Dlugosz wrote:
Show 7 quoted lines
>> Generally when I keep changes like this, I make a commit called  
>> "Local
>> Changes" or similar and have branch.master.rebase set to true so that
>> my changes get rebased on top of origin when I pull.
>
> That sounds ideal.  However, I don't understand the specific steps you
> mention.  Looking in the help for git-config,

As Junio and Linus have pointed out, most pulls will ignore local changes, so this is likely overkill unless your changes are in commonly changed files.

Show 10 quoted lines
> So, assuming you are working on the "master" branch, this will rebase
> the pulled content on top of the existing "master" rather than  
> merging.
> If my local changes are committed to "master" first, then this will  
> take
> all the commits from other developers that I don't already have in my
> local copy and apply them on top of my existing (including Local
> Changes).  But since those will now be different commits, what happens
> next time?  Ah, "...which introduce the same textual changes..." so
> that's covered in how rebase works.
You can set branch.master.rebase with
   git config branch.master.rebase true

It actually works the other way. Your changes will be rebased on top of the work from other developers.

A--B--E--F  origin/master
     \
      C--D master
will become
A--B--E--F  origin/master
           \
            C'--D' master

I share most of my changes using format-patch and e-mail instead of pushes, so I just don't generate patches for my unimportant changes. For pushing, I'd suggest either working on new features in a different branch ("topic" and "local" for example), or using "rebase -i" to move your local changes to the top and using "push HEAD^".

~~ Brian
Previous: John DlugoszNext: John Dlugosz
Message 4 of 17 in “Files different for me”
  1. John DlugoszFeb 25, 2009
  2. Brian GernhardtFeb 25, 2009
  3. John DlugoszFeb 25, 2009
  4. Brian GernhardtFeb 25, 2009
  5. John DlugoszFeb 25, 2009
  6. Matthieu MoyFeb 25, 2009
  7. Junio C HamanoFeb 25, 2009
  8. Linus TorvaldsFeb 25, 2009
  9. Junio C HamanoFeb 25, 2009
  10. Linus TorvaldsFeb 25, 2009
  11. Junio C HamanoFeb 25, 2009
  12. Linus TorvaldsFeb 25, 2009
  13. Jay SoffianFeb 25, 2009
  14. John DlugoszFeb 25, 2009
  15. John DlugoszFeb 25, 2009
  16. Junio C HamanoFeb 25, 2009
  17. Feanil PatelFeb 25, 2009

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.