How to use git in Linux Command
Aim:a more convenient way to revise and synchronise git repositories.
Install Git
use command: git clone https://github.com/git/git
use command to check git version: git –version
Usage
-download git repositories in current file path: git clone …
-do revise by Linux command, like rm, vim, mv ..
-if you add new files or new path, use command: git add [FileName]
-After revise, use command to make sure all changes: git commit -a
-Or use command with comments: git commit -m “comments”
-Finally, synchronise local repositories to remote repositories:git push
undo
use git add wrongly:
git status 先看一下add 中的文件 git reset HEAD 撤销上一次add里面的全部内容 git reset HEAD XXX/XXX/XXX.java 针对某个文件进行撤销
Reference
参考: 常用 Git 命令清单
Support or Contact
xzhangxmu@gmail.com