未经许可请勿转载。
Please do not reprint this article without permission.
Useful Docs
- Git Tutorial
- git branch(分支命令的使用)
- github 远程仓库名或地址修改,本地如何同步
- git merge出现 fatal: refusing to merge unrelated histories 错误
- 在github上创建代码仓库时忘记添加.gitignore文件或修改了.gitignore该怎么办?
- Git 分支 - 分支的新建与合并
- git remote命令
Common Usage
git status
git log
git init # create local repository
git remote add origin {remote-repository-url}.git # operations on remote repository
git pull # pull from remote repository
git add -A # git add /path/to/a/specific/file
git commit -m "Commit message."
git push -u origin master # push to the master branch of remote repository
git branch {new-branch-name} # create a new branch
git checkout {branch-name} # switch to another branch
git merge {another-branch} # merge another branch
git rm -r --cached {file-to-ignore} # untrack file to ignore