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?
But in SVN, apparently, there is no such staging state.
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.
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.
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.
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
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With