本地使用git:
创建并进入一个目录,mkdir learn-git, cd learn-git
创建git仓库:git init
添加文件到仓库:git add readme.txt
提交文件到仓库:git commit -m "write a readme file"
查看提交日志:git log
退回上一版本: git reset --hard HEAD^
查看历史commit ID:git reflog
退回指定版本:git reset --hard commit-ID
Git鼓励大量使用分支:
查看分支:git branch
创建分支:git branch <name>
切换分支:git checkout <name>
创建+切换分支:git checkout -b <name>
合并某分支到当前分支:git merge <name>
删除分支:git branch -d <name>
查看工作区状态:git status
临时存储工作现场:git stash
查看临时工作现场:git stash list
恢复工作现场(恢复并删除stash内容);git stash pop
恢复工作现场(仅恢复,不删除stash内容): git stash apply
删除stash内容:git stash drop
如存在多个stash内容的时候,使用 git stash apply stash@{0}
git 查看远程库 git remote 或者 git remote -v
72万+

被折叠的 条评论
为什么被折叠?



