版本控制git的简单使用

0.第一次使用时配置:

 git config --global user.name "your_name"
 git config --global user.email "your_name@domain.com"

用的最多的:
(查看当前git状态)

git status

1.初始化:

git init

2.添加文件(.处为要提交的文件):

git add .

3.提交(“”内为提交的操作名,根据实际填写):

git commit -m “Start project”

4.查看提交日志:

git log

只显示主要信息:

git log --pretty=oneline

5.修改后提交修改:

git commit -am “Extended modify”

6.修改文件但是想回到上一次提交的结果:

git checkout .

7.恢复到指定提交ID处:

git reset --hard 585e

8.删除所有git提交记录:

rm -rf .git

(也可以手动点击删除.git文件)

posted @ 2020-04-10 20:21  baowang  阅读(146)  评论(0编辑  收藏  举报