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

Re: Locally manage user/branch setting files without pushing them remotely

From
DSDaniele Segato <daniele.bilug@gmail.com>
Date
Nov 11, 2009, 13:00 UTC
Message-ID
<9accb4400911110500y37437dc5h16388b07a734dc6d@mail.gmail.com>
In-Reply-To
<551f769b0911110414j759bd4ayfedfa779307e1a63@mail.gmail.com>
On Wed, Nov 11, 2009 at 1:14 PM, Yann Simon <yann.simon.fr@gmail.com> wrote:
Show 14 quoted lines
> I am in the same situation.
> What I did is not to add these files to .gitignore.
> On my "work" branch, I commited these files in a separate commit
> "local changes".
> When I want to push to svn, I switch to the branch "master", and
> cherry-pick the commit I want to push.
> $ git checkout master
> $ git svn rebase
> $ git cherry-pick work
> $ git svn dcommit
> $ git checkout work
> $ git rebase master
>
> This workflow could maybe be better. Suggestions welcome.

hum but I don't want to push those files

the idea of placing those files in a separate commit could be handy... If I create a branch for each version of the file: example experiments-local, master-local then I could keep version of the file there and cherry pick them when needed

like this:

$ git checkout experiment $ # do work $ git commit -a -m "my recent work" $ git cherry-pick experiment-local $ # test / compile / whatever $ git reset --hard HEAD~ # undo the cherry-pick because i don't want to push it $ git svn dcommit / git chechout another-branch

but I could forgot to reset --hard HEAD~ and I had to be very careful...

instead I would place those files in separate stash called "experiments", "master" and apply the right stash when I need and then discard it before switching branch.. this is something I hadn't thinked about

$ git checkout experiment $ # do work $ git stash apply experiment-stash # don't know if i could use name to reference stashes # test / compile / whatever $ rm mypropfile.properties $ git add <files...> $ git commit $ git svn dcommit / git checkout another-branch

this way I still had to remove the file manually but since I never use git commit -a I probably wouldn't add it to a commit by mistake.

This could be more handy then the way I act now... still I hope there is a better way to handle situations like this

regards, Daniele

Previous: Yann SimonNext: Yann Simon
Message 3 of 10 in “Locally manage user/branch setting files without pushing them remotely”
  1. Daniele SegatoNov 11, 2009
  2. Yann SimonNov 11, 2009
  3. Daniele SegatoNov 11, 2009
  4. Yann SimonNov 11, 2009
  5. Paolo CiarrocchiNov 11, 2009
  6. Nicolas SebrechtNov 11, 2009
  7. Daniele SegatoNov 12, 2009
  8. Nicolas SebrechtNov 12, 2009
  9. Daniele SegatoNov 12, 2009
  10. Nicolas SebrechtNov 12, 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.