Equivalent of “svn checkout” for git?

守給你的承諾、 提交于 2019-12-08 18:48:28

问题


What git command should I use to be equivalent to svn checkout?

git checkout(?)

Many thanks!


回答1:


git clone is more of an analogue to svn checkout than git checkout. git checkout just checks out a branch or commit from your local repository. git clone makes a new copy of a remote repository.




回答2:


This is exactly what I wanted:

SVN

$ svn checkout svn://foo.googlecode.com/svn/trunk foo
# make your changes
$ svn commit -m "my first commit"

GIT

$ git clone git@github.com:pjhyett/foo.git
# make your changes
$ git commit -a -m "my first commit"
$ git push

from Git for beginners: The definitive practical guide



来源:https://stackoverflow.com/questions/18900774/equivalent-of-svn-checkout-for-git

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!