git操作
git clone
git clone https://github.com/openbmc/openbmc.git
git branch -a
git branch -a
git fetch origin
jack_code/202208/openbmc$ git fetch origin xx:xx
git checkout
jack_code/202208/openbmc$ git checkout xx
Updating files: 100% (14730/14730), done.
备注:
操作不被允许,执行如下:
jack_code/202208/openbmc$ chmod 777 -R jack_code/
git pull origin xx
jack_code/202208/openbmc$ git pull origin xx
Already up to date.
git merge master
将暂存区代码更新到本地工作区
git pull --force origin xxx : xxx
强制覆盖
git checkout -b xxx
创建新分支
git push origin HEAD:refs/for/xxx
上传代码
git branch -r
查看远程所有分支
git branch
查看本地所有分支
git branch -a
查看本地及远程的所有分支
git fetch
将某个远程主机的更新,全部取回到本地
git remote -v
查看仓库关联情况
git status
查看git状态
git log
常看git日志
git log --oneline
查看精简git日志
感谢阅读,祝君成功!
-by aiziyou