git 自己易忘的命令

1. git 更新远程分支列表

git remote update origin --prune
git remote update origin -p

2. 查看远程分支:

git branch -a

注:git branch 获取本地分支, -r 远程分支, -a 远程和本地分支

3. 拉去远程分支到本地

  • 拉去远程test分支到本地,并切换到本地test分支
git checkout -b test origin/test

注: 此操作需要确保本地现工作分支与远端分支test,没有冲突

原文地址:https://www.cnblogs.com/spaceapp/p/10395474.html