Basic Usage
The four commands above copy files between the working directory, the stage (also called the index), and the history (in the form of commits).git add files
copies files (at their current state) to the stage.git commit
saves a snapshot of the stage as a commit.git reset -- files
unstages files; that is, it copies files from the latest commit to the stage. Use this command to "undo" agit add files
. You can alsogit reset
to unstage everything.git checkout -- files
copies files from the stage to the working directory. Use this to throw away local changes.
git reset -p
, git checkout -p
, or git add -p
instead of (or in addition to) specifying particular files to interactively choose which hunks copy.Read More
No comments :
Post a Comment