关于git:Git版本管理工具的最佳学习路径

1次阅读

共计 954 个字符,预计需要花费 3 分钟才能阅读完成。

Git 是一个分布式版本控制软件,本文介绍了该工具的典型学习门路,并列数了必须要非常理解的要害命令。

独立根本应用

作为版本管理工具仅为了保留订正历史,在不思考与其他人合作与多版本保护时,你须要相熟以下命令。

git init
git clone <repository>
git status
git add <file>
git add --all
git commit
git remote add
git remote set-url
git remote -v
git push <repository> <branch>
git pull <repository> <branch>

要害的配置

当你应用的越来越多时你会发现有些操作很繁琐,这时候你须要学习一些要害配置,使你本人的差别诉求失去满足。

git log 
git checkout <file>
git reset <file> 
git reset --hard 
git clean -f 
git rm <file> 
git config --global user.name
git config --global user.email
git stash
git stash apply
git stash clear 

多人合作应用

当你须要与其他人独特保护一个我的项目时,你须要把握相应的分支检出、分支创立、分支合并、查看订正历史等性能。

git merge
git branch
git checkout <branch>
git checkout -b
git blame <file>
git rebase
git push --force-with-lease (DANGEROUS)

版本管理员

如果你从事我的项目的版本管理工作,那么你须要理解更业余的一些操作,包含更具体的查看分支、比拟分支、复原版本、更改订正、修复版本问题等。

git commit --amend
git rebase -i
git prune
git fetch
git remote prune
git checkout HEAD/HEAD~1/<commit hash>
git diff <commit hash 1> <commit hash 2>
git revert <commit hash>
git reflog
git-filter-branch
git-filter-repo
git bisect

版权申明,本文首发于 数字魔盒 https://www.dm2box.com/ 欢送转载。

正文完
 0