Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jul 072011
 

Stage new and modified files in Git

Answer:

To stage new and modified files so that they will be committed in the future, you can use the simple command:

# git add .

So all the newly created and modified files will be staged.

Jun 292011
 

How to revert a bad commit in SVN

Answer:

In SVN, if you have committed something wrong, how do you rollback it?

You cannot use the svn revert command since it has been commited, you need to do a merge instead

E.g. Rollback from current version to revision 98

# svn merge -r HEAD:98 http://example.com/svn/repos/demo/trunk 
# svn commit -m "Reverting previous bad commit and going back to revision 98"
Jun 232011
 

Import files and directories into a SVN repository

Answer:

To import files and directories into a SVN repository, you can use the svn import command.

E.g.

Import all files and directories under the current working directory "project1" to a local SVN repository

# cd /data/project1
svn import file:///data/svn/project1