-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitHelp
More file actions
32 lines (19 loc) · 1011 Bytes
/
gitHelp
File metadata and controls
32 lines (19 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
git的使用帮助
一、上传代码
git status
git add file(如果要删除工作目录的文件(即:工作目录有但是本地没有)同样git add)
git commit -m "log that displayed others can make other people understand your work content. "
git push (git push origin master)
二、撤回commit
git commit --amend 更改commit 提交的内容
git reset --soft HEAD^ 仅仅是撤回commit操作,您写的代码仍然保留
备注:HEAD^等价于HEAD~1。撤回俩次commit 则用HEAD~2.
git reset --hard HEAD^ 撤回commit并且本地代码同样也被修改
三、找回git reset --hard HEAD^丢失的本地代码
git feflog 找到对应的commitID
然后git reset --hard commitID
二、git 的英文文档
git status:
Displays paths that have differences between the index file and the current HEAD commit,
paths that have differences between the working tree and the index file,
and paths in the working tree that are not tracked by Git