# Git 常用命令
📆 2021-12-14 11:59
提示
[] 中的内容替换成实际内容
# 查看远程仓库
git remote -v
# 添加远程仓库
git remote add [origin] [http://git.com/project.git]
# 删除远程仓库
git remote rm [origin]
# 查看远程分支
git branch -r
# 查看本地分支
git branch
# 切换分支
git checkout [master]
# 删除分支
git branch -d [master]
# 放弃本地修改
git reset --hard
# 设置项目用户名
git config user.name [username]
git config user.email [email]
# 设置全局用户名
git config --global user.name [username]
git config --global user.email [email]
# 记住用户名密码
vi .git/config
# 增加
[credential]
helper = store