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

Re: I never want to push a given change

From
Brian Gernhardt <benji@silverinsanity.com>
Date
Jul 17, 2007, 03:12 UTC
Message-ID
<76ACB85D-2969-406A-AA11-EAF2A104B9E7@silverinsanity.com>
In-Reply-To
<916b88c10707160918n7a4948g5fb55a9d8ace9833@mail.gmail.com>
On Jul 16, 2007, at 12:18 PM, nathan bullock wrote:
Show 12 quoted lines
> I have been using git for a little while and one thing that I would  
> like to
> be able to do is never push a given change, or set of changes.
>
> So lets say I clone a .git repository. Then I make a couple of changes
> that I don't want anyone else to see, do a commit. Then I make some
> other changes that I want everyone else to see and do another commit.
>
> How do I push just the second commit?
> And how do I make it so that every other time I do a push after  
> this that
> first commit will never be sent?

Generally the way I do such things is multiple branches. Have a branch "local" (or a more descriptive name) that isn't pushed out anywhere. Place any changes you do NOT want shared on that brach. Place changes to be shared on the master or appropriate topic branch. Instead of committing changes to be shared on top of the local ones, use "git rebase" to keep the local branch on top of the shared ones.

~~ B
Previous: nathan bullockNext: nathan bullock
Message 2 of 4 in “I never want to push a given change”
  1. nathan bullockJul 16, 2007
  2. Brian GernhardtJul 17, 2007
  3. nathan bullockJul 17, 2007
  4. Brian GernhardtJul 17, 2007

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.