svn“git add”替代? [英] svn "git add" alternative?

查看:111
本文介绍了svn“git add”替代?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要对git仓库进行一些更改,我必须先将它添加到阶段状态。如果我不添加一个文件来提交它不会去回购。



但是在SVN中,显然没有这样的暂存状态。我对我的工作副本所做的每一项更改都会通过下一个svn commit进行回购。我怎样才能防止一些本地更改的文件得到提交而无需恢复更改?

解决方案

svn commit 命令使用可选的文件名参数来限制要提交的文件集:

  svn commit -mmy提交file1.txt file2.txt 

您也可以使用changelist功能将一个或多个文件分组到一个更改列表中,可以用一个命令提交。这比Git稍微灵活一些,因为你不能只添加一个文件的一部分(比如用 git add -p )。


To commit some changes to a git repo I must add it to the staged state first. If I don't add a file to commit it will not go to the repo.

But in SVN, apparently, there is no such staging state. And every change I made to my working copy goes to the repo with next svn commit. How can I prevent some locally changed files get commited without reverting the changes?

解决方案

The svn commit command takes optional filename parameters that limit the set of files to commit:

svn commit -m "my commit" file1.txt file2.txt

You can also use the "changelist" feature to group one or more files into a changelist, which can be submitted in one command. This is still slightly less flexible than Git, because you can't add just a portion of a single file (such as with git add -p).

这篇关于svn“git add”替代?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆