您的位置:首页 > 其它

Git file

2016-04-15 14:50 417 查看
In a local repository.

1. add first.txt to repository, use Git bash

$ git add first.txt


2. commit change

$ git commit -m 'my first commit'

3. check content change
$ git diff first.txt

4. commit change
$ git commit -m 'my second commit'

5. remove a file



$ git rm Documentation/\*.txt


6. test if the file exists and can be removed



$ $ git rm -n aa.txt
[/code]
7. Revert the changes specified by the fourth last commit in HEADand create a new commit with the reverted changes.

git revert HEAD~3


8.revert a commit


git revert 64158c6f740083d89b25575c82e2413548e1a5f0
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: