git checkout helloworld.txt

来源:互联网 发布:被删除的数据如何恢复 编辑:程序博客网 时间:2024/05/16 07:22
[root@localhost helloworld-git]# echo "helloworld" >helloworld.txt
[root@localhost helloworld-git]# git add helloworld.txt
[root@localhost helloworld-git]# git commit -m 'helloworld-master'
[master (root-commit) fddae22] helloworld-master
 Committer: root <root@localhost.localdomain>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:


    git config --global user.name "Your Name"
    git config --global user.email you@example.com


After doing this, you may fix the identity used for this commit with:


    git commit --amend --reset-author


 1 file changed, 1 insertion(+)
 create mode 100644 helloworld.txt
[root@localhost helloworld-git]# git log
commit fddae22359221092ade97421800f308f0d8e3886
Author: root <root@localhost.localdomain>
Date:   Thu Mar 21 16:50:51 2013 +0800


    helloworld-master
[root@localhost helloworld-git]# echo "world hello">helloworld.txt
[root@localhost helloworld-git]# cat helloworld.txt
world hello
[root@localhost helloworld-git]# git checkout helloworld.txt
[root@localhost helloworld-git]# cat helloworld.txt
helloworld
[root@localhost helloworld-git]# 
原创粉丝点击