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.
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
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.
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"
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
Revert uncommitted change in Git
Answer:
To revert the changes of a uncommitted file in Git, you need to use the following command:
# git checkout file
Setting up local username and email with git
Answer:
Before you make any changes to a local git repos, it is always recommended to setup you username and email first.
To do so, use the commands below:
# git config --global user.name "John Doe"
# git config --global user.email [email protected]
That's it.