我可以“svn up”吗? git 的行为?
我的大部分新项目都使用 git,遗留项目则使用 Subversion。
在 Subversion 中,我可以将项目检出到两台机器(即笔记本电脑和台式机)。这样我就可以在笔记本电脑上的分支中进行编辑,并使用 svn ci 签入它们。然后在桌面计算机上,我可以在该分支中运行 svn up 来获取更改。
git 是否有类似的工作流程?
I use git for most of my new projects and Subversion for legacy projects.
In Subversion, I can checkout a project to two machines (i.e., laptop and desktop). This way I can make edits in a branch on the laptop and check them in with svn ci
. Then on the desktop machine, I can run svn up
in that branch to pickup the changes.
Is there a similar workflow available with git?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您将:
git pull
)git add
,git commit
)git Push
)git pull
)You would:
git pull
)git add
,git commit
)git push
)git pull
)当然有。相当于
svn ci
的 git 是git commit -a
后跟git push
,相当于svn up
是 git pull 。除此之外,它与 Subversion 几乎相同。使用 git,如果您能够通过 ssh 从一台笔记本电脑连接到另一台笔记本电脑,您还可以直接从桌面将更改拉取到笔记本电脑。为此,您可以在笔记本电脑上运行
或者您可以运行
一次来设置命名远程,然后
There certainly is. The git equivalent to
svn ci
isgit commit -a
followed bygit push
, and the equivalent tosvn up
isgit pull
. Otherwise, it's pretty much the same as with Subversion.With git, you can also directly pull changes to your laptop from your desktop, if you are able to connect from one to the other with ssh. To do this, on your laptop you would run
Or you could run
once to set up a named remote, then
您可以使用类似于
svn ci
的方式使用git Push
,而git pull
将完成剩下的工作。You use
git push
similarly tosvn ci
, andgit pull
will do the rest.svn ci
大约是git add
后跟git commit
(或者如果你总是提交,就使用git commit -a
每个更改的文件)。svn up
大致相当于git pull
。哦,听起来你想要一个远程跟踪分支 - 查一下,它们有详细的记录。
svn ci
is approximatelygit add
followed bygit commit
(or just usegit commit -a
if you always commit every changed file).svn up
is roughlygit pull
.Oh, and it sounds like you want a remote tracking branch - look it up, they're well documented.