Git 图解
2021-08-21 16:15:48 0 举报
Git 基本用法总结
作者其他创作
大纲/内容
HEAD
save the current state: git stash (and then you can switch other branches)recover from stash:git stash listgit stash pop (or git stash apply xxx)
show diff: git diff HEAD -- file1 check status (before commit): git status
...
remote repo info:git remote [-v]
git cherry-pick m
Branch (dev)
remove the branch: git branch -d test
file1
Branch (test)
commit n
commit 1
remove file2: git rm file2git commit
git addgit status
git clone xxxgit checkout -b dev origin/dev
file2
Container
git push origin mastergit push origin dev
create tag for commit:git tag -a v0.1.1 [-m \"version 0.1.1 released\"] ngit show v0.0.1git tag
(git branch --set-upstream-to=origin/dev dev)git pull(git rebase)git push origin dev
git reset --hard HEAD^
git reflog
git switch mastergit merge [--no-ff -m \"merge with no-ff\"] dev
Branch (master)
git reset --hard n
Local Repository
Remote Repository
commit m
commit n+1
Staging area
git checkout -- file1
Work tree
commit n-1
branch management example:
commit 2
(first push)git remote add origin xxxgit push -u origin master
git reset HEAD file1
git branch devgit switch dev
git log[--graph][--pretty=oneline][--abbrev-commit]
git commit
0 条评论
下一页