git 常用命令

[TOC]

git

放弃本地修改

git fetch --all
git reset --hard origin/master

git stash

git stash save 名称

git stash pop

git tag

git tag -a tagname
# -a: 创建一个带注解的标签

# 查看所有标签
git tag

# 切换至某一个标签
git checkout tagname

# 删除标签
git tag -d tagname

删除文件

# 删除文件
git rm <file>
# 停止跟踪文件但不删除
git rm --cached <file>

不需要每次都输入密码

git config --global credential.helper store

发表评论