git

git

git commit --amend -m "xx"
在没有push前 合并提交记录

本地已经有了upstream上游全部分支

git  fetch upstream  获取数据
(git pull upstream     获取数据    git pull upstream xx  获取某一个分支数据)
git merge upstream/xxx   合并至本地分支xx
git  push -u origin xx         推送至远程并关联本地默认远程分支

上游upstream新增加了分支

git  fetch upstream  获取数据
git checkout -b new  upstream/new    由远程upstream新增加的upstream/new分支创建本地新分支new
*git merge upstream/new   合并至本地分支xx,后续有新增加内容*
git  push -u origin new         推送至远程并关联本地默认远程分支
git pull --rebase =git  fetch  +  git rebase
git branch -u origin/master   将本地分支和远程创建关联
git  push origin master     远程分支不存在则创建,存在则推送内容
git push -u origin master  远程分支不存在则创建,存在则推送内容,并关联远程分支
git branch -vv   查看分支对应的远程分支
git remote -v
git branch -a
git reset --mixed  将本地commit记录和暂存区内容回滚,工作区内容保留
git  reset --hard  将工作区.暂存区及commit提交记录全部回滚
git reset --soft   只将commit记录回滚

posted @ 2023-06-02 01:08  三分看七分练  阅读(24)  评论(0)    收藏  举报