Git 其他操作


远程仓库

1、查看远程仓库

git remote -v

分支管理

1、查看所有分支

git branch

2、新建分支

git branch branchName

3、删除分支

git branch -d branchName

4、合并新分支到当前分支

git merge newBranchName

历史管理

1、查看提交历史

git log

标签管理

1、添加标签

git tag -a v1.0.0

2、查看标签

git tag

3、删除标签

git tag -d v1.0.0

回滚到某次提交

1、reset 操作,在 commit_id 之前的内容将会丢失。

git reset --hard commit_id

2、强行提交

git push --force

3、revert 操作,之前提交的还存在,可能需要 merge

git revert -n commit_id

4、提交

git commit -m "revert something"
Git