Skip to content

violetrooty/gitskills

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gitskills

快照在Git中被称为commit

git checkout -- file可以丢弃工作区的修改

版本回退

git reset --hard HEAD^

git reset --hard 1094a

git reset命令既可以回退版本,也可以把暂存区的修改回退到工作区

git log可以查看提交历史

git reflog查看命令历史

分支

查看分支:git branch

创建分支:git branch <name>

切换分支:git checkout <name>或者git switch <name>

创建+切换分支:git checkout -b <name>或者git switch -c <name>

删除分支:git branch -d <name>

合并某分支到当前分支:git merge <name>

查看分支合并情况:git log --graph --pretty=oneline --abbrev-commit

git merge了错误分支,如何回退到merge前的状态:git reset --hard HEAD^

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors