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

Re: What's the best way to make my company migrate to Git?

From
DSDaniele Segato <daniele.bilug@gmail.com>
Date
Jun 1, 2010, 17:16 UTC
Message-ID
<AANLkTimnQJmctLU1LmT1x3KhB84J2Wrqsa8Nfo5vVDLI@mail.gmail.com>
In-Reply-To
<1533278916.20100601231415@yandex.ru>
2010/6/1 Alexander Iljin <ajsoft@yandex.ru>:
> Hello!
>
> DS> You also can't create new Subversion branches or tags with git-svn,

I've been corrected on this: git svn tag and git svn branch are there for that purpose.

>  Another point: you can't contribute to branches via git-svn, you can
>  only commit to trunk. It is easy to be confused if you've created a
>  feature branch in Git. If you then want to git-svn dcommit a
>  half-done work, you will mess up the trunk.
that's not correct

You can contribute to any subversion branch, but you have to do it with a local branch tracking the remote one

say you are on "master" which track remote svn "trunk" and you want to contribute to remote branch "v1.x"

you can do this:
git checkout -b myBranch-v-1-x v1.x

it will checkout the remote v1.x creating a new label "myBranch-v-1-x" for tracking it. you can then work on myBranch-v-1-x as usual, when you'll git svn dcommit from there you'll commit on the remote v1.x branch.

but you have to be careful with cherry-picking.

if you want to cherry pick a comment on trunk to commit it on branch v1.x you'll have to amend it removing the line:

git-svn-id: https://your-svn-url/repos/trunk@1234 a123123....
or you'll not be able to commit on the remote v1.x branch.
I created a local alias for cherry-picking an a safe way for subversion:
[from alias section in my .gitconfig]
cherry-pick-svn =  !GIT_EDITOR='sed -i /^git-svn-id:/d' git cherry-pick -e

which do a normal cherry-pick automatically editing the commit to remove that line.

may be this could be added to the svn alias list?

Regards, Daniele Segato

Previous: Alexander IljinNext: Alexander Iljin
Message 17 of 27 in “What's the best way to make my company migrate to Git?”
  1. Daniele SegatoMay 21, 2010
  2. Jakub NarebskiMay 21, 2010
  3. Daniele SegatoMay 22, 2010
  4. Jakub NarebskiMay 22, 2010
  5. Joshua JensenMay 22, 2010
  6. Andrew SayersMay 22, 2010
  7. Daniele SegatoMay 22, 2010
  8. Andrew SayersMay 23, 2010
  9. Daniele SegatoMay 24, 2010
  10. Lin MacMay 23, 2010
  11. Andrew SayersMay 23, 2010
  12. Michael J GruberMay 25, 2010
  13. Andrew SayersMay 31, 2010
  14. Michael J GruberJun 1, 2010
  15. Daniele SegatoJun 1, 2010
  16. Alexander IljinJun 1, 2010
  17. Daniele SegatoJun 1, 2010
  18. Alexander IljinJun 1, 2010
  19. Erik Faye-LundJun 1, 2010
  20. Daniele SegatoJun 1, 2010
  21. Andrew SayersJun 1, 2010
  22. Andreas KreyJun 2, 2010
  23. Michael J GruberJun 2, 2010
  24. Andrew SayersJun 5, 2010
  25. Steven MichalskeJun 6, 2010
  26. Sylvain RabotJun 2, 2010
  27. Daniele SegatoMay 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.