Le 2014-07-23 23:58, Gilles a écrit :
On Wed, 23 Jul 2014 08:36:55 +0200, Luc Maisonobe wrote:
Le 23/07/2014 00:05, Gilles a écrit :
On Tue, 22 Jul 2014 10:01:44 -0700, Phil Steitz wrote:
Looks like other projects are running VOTEs to ensure there is
consensus for this action and including references to VOTE threads
in INFRA JIRAs.  Lets do this.  The action I am proposing is that we
request a new ASF git repo, make the current svn repo read-only
(adding a README to make it clear) and change github mirroring to
use the git repo.   Votes, please.  This vote will close in 72
hours.  Note that this VOTE applies only to [math], i.e.
http://svn.apache.org/repos/asf/commons/proper/math.

[ ] +1 go for it
[ ] +0 OK, but...
[ ] -0  Not happy about this, because...
  [X] -1 We should not do this if that means that I have to know how
         to use "git" within the next 72 hours.

Please clarify the migration planning, including the necessary transition for complete newbies (e.g. a summary of how to perform the equivalent of
such basic tasks as "svn co", "svn add", svn del", "svn commit",
"svn diff").

There is an extensive tutorial for git as the Git book:

 <http://www.git-scm.com/book>


For a quick reference, here is a cheet sheet for subversion users:

<http://www.git-tower.com/blog/git-for-subversion-users-cheat-sheet-detail/>

For an even quicker reference on the most used commands, here is
a mapping :

  Concerning the other commands, here are some hints:

 svn co      --->  git clone
 svn add     --->  git add
 svn rm      --->  git rm
svn commit ---> git commit, then git push (rationale explained below)
 svn diff    --->  git diff
 svn update  --->  git pull

From my own experience, the first thing to understand for the difference
between subversion and git is that in the later there is a separation
between "committing" a change, and "pushing" it to the reference remote repository. The reason this is a two-stage process in git is that there are many different repositories and when you "commit" you do it on your
local repository, which is on your own hard drive. So after this first
step, the only person who can see the change is the one who can see this local repository: you. If you want other people to see your change, you
have to perform the second step and "push" your repository to a
reference one shared with other developers (i.e. in our case the one on Apache infrastructure). This difference seems at first cumbersome for a subversion user, and at the beginning we always forget to push and don't
understand why people do not see our commits. After some time, it
appears really a good thing, as it allows to work locally using full
source code versioning features without any risk of breaking things on
the main shared repository.

Thanks, Luc.

If I could just ask:
* What are the actual command(s) to create a Commons Math local repository?

From the command line, using the current read-only version of the repository, this would be :


  git clone http://git.apache.org/commons-math.git

From this, you would be able to do local commits (since you have now a local repository, which is a full-fledge repository, you can commit in it). However, you cannot push to
the remote Apache repository afterwards since it is read-only.

* Did I understand correctly that we can already interact with the svn
  repository, using a local git repository?

Yes. This is what I have done for the last one or two years with Apace Commons Math. There is an extension to git named git-svn that set up a bridge between the two systems: the remote repository is the svn server, and locally you can have a git repository. So from the client side you do your commits using git commands, and when you want to push them the bridge uses svn protocol to communicate with the remote svn server. The server is
not aware you are not using svn locally.

I think (but am not sure), that you can convert the git repository you cloned from the read-only git repo so it is aware of the ral svn server. You should first clone the repo using git clone as above, then go in the cloned workspace and run something like

  git svn init --stdlayout https://er...@svn.apache.org/repos/asf

I am not sure how deep the URL above should be set.

Git-svn is packaged separately from regular git. On my Debian system, there is a "git"
package and a "git-svn" package, and I need both.

The bridge is not perfect, and it is not recommended to try to mix local git branches and
remote svn branches, however it works quite well.

One point is also that since the remote repository is not a git repository but a svn repository, the command used to push commits is not "git push" but rather "git svn dcommit". The command to update the local repository is also not "git pull" but rather "git svn rebase".


You can also look at <https://git-wip-us.apache.org/>.



I also found another course for migrating from subversion to git here: <https://git.wiki.kernel.org/index.php/GitSvnCrashCourse>

best regards,
Luc



Best regards,
Gilles


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to