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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/6/1 Alexander Iljin <ajsoft@xxxxxxxxx>:
> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]