标签:
Recently,we had learned how to make version control during the development of software system.
Among all those tools,git is one of the most powerful one.And our team learned how to use it in a
short time by learning from a blog written by LiaoXuefeng.
1.Install git
Thanks to our team member LinChun,his MacPro can directly use git beacause he had installed XCode.
2.Create a repository
create a directory
init the repository and add a file to it
use "git add" to add files to temporary storage area
"git commit" to add files to repository
the readme.txt
3."git status" and "git diff"
"git status" is to see the current status of the repository,eg:
"git diff" is to check the difference ,eg:
4.update the version of the file
first,make changes to readme.txt
add it,commit it,check it
repeat the process to get three different version of the text file,then we can
use "git log" to see the logs of our versions
5.use command to roll back
"git reset --hard Head(parameter to determine which version to roll back to)" eg:
after rolling back,we can check the log to verify
if we forget what we have done before,we can use "git reflog" to see the
history of what we have done,eg:
6.delete files in git
rm just delete your file from the working directory
if you really want to delete the file from the repository,use "git rm"
It's our first time to meet git
标签:
原文地址:http://www.cnblogs.com/bwju/p/4440206.html