git config --global user.name "yanghaifeng" git config --global user.email "573618722@qq.com"
git clone http://192.168.12.123:6666/group-dataanalyzer/dataanalyzerfront.git cd dataanalyzerfront touch README.md git add README.md git commit -m "add README"
cd existing_folder git init git remote add origin http://192.168.12.123:6666/group-dataanalyzer/dataanalyzerfront.git git add . git commit -m "Initial commit"
cd existing_repo git remote rename origin old-origin git remote add origin http://192.168.12.123:6666/group-dataanalyzer/dataanalyzerfront.git
git branch --set-upstream-to=origin/master master 本地分支与远程分支建立关联 git branch --unset-upstream feature/test 本地分支与远程分支取消关联
和reset主要有两点区别,1>revert不会毁尸灭迹,会新增一条记录 2>如果合并的某个分支在操作过程中修改了内容,revert 能够实现仍然合并修改之前的所有分支,reset 则只能合并某一个修改之前的分支
先用git reflog,查看到记录