Appearance
Git相关操作
更换仓库地址
shell
git remote -v
git remote rm origin
git remote add origin xxxor
shell
git remote set-url origin xxxgit拉取所有分支
shell
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all推送本地所有分支
shell
git push --all origin -u切换(并创建)分支
shell
git checkout [-b] branch放弃更改相关
- 未提交到暂存区
shell
git checkout .- 已提交暂存区
shell
git reset HEAD .- 已执行commit操作
shell
git reset --hard HEAD^命令行储存密码
bash
git config credential.helper store