Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"git add" equivalent in svn?

Tags:

git

svn

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?

like image 261
Vanuan Avatar asked Apr 28 '11 10:04

Vanuan


People also ask

Does SVN have a staging area?

But in SVN, apparently, there is no such staging state.

Is git add the same as git add?

The difference lies in which files get added. git add -A command will add all modified and untracked files in the entire repository. Whereas git add . will only add modified and untracked files in the current directory and any sub-directories.

What does the command git add do?

git add. The git add command adds a change in the working directory to the staging area. It tells Git that you want to include updates to a particular file in the next commit.

Is there a git add all command?

The easiest way to add all files to your Git repository is to use the “git add” command followed by the “-A” option for “all”. In this case, the new (or untracked), deleted and modified files will be added to your Git staging area.


1 Answers

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).

like image 144
Greg Hewgill Avatar answered Sep 21 '22 09:09

Greg Hewgill