git新建分支和合并fork分支
1.新建和删除分支
javascript
git checkout --orphan emptybranch
git rm -rf .
echo '# new branch' >> README.md
git add README.md
git commit -m 'new branch'
git push origin emptybranch
2.回滚代码
javascript
git reset --hard 目标版本号"
git push -f
3.合并分支
javascript
git remote add upstream <原仓库git地址>
git fetch upstream
git merge origin2/master --allow-unrelated-histories
4.删除分支
javascript
git checkout <another_branch>
git branch -d <branch_name>
git branch -D <branch_name>
git push <remote_name> --delete <branch_name>
5.仓库迁移
javascript
git clone --bare ssh://url
cd xxx-ui.git/
git push --mirror ssh://url