简易的命令行入门教程:
Git 全局设置:
git config --global user.name “xx”
git config --global user.email “xxxxxx@qq.com”
创建 git 仓库:
mkdir yunqi-system-yqshop-api
cd yunqi-system-yqshop-api
git init
touch README.md
git add README.md
git commit -m “first commit”
git remote add origin https://gitee.com/zyr_admin/yunqi-system-yqshop-api.git
git push -u origin master
已有仓库?
cd existing_git_repo
git remote add origin https://gitee.com/zyr_admin/yqshop-api.git
git push -u origin master
git remote rm origin // 移除本地关联
git remote add origin git@github.com/example.git // 添加线上仓库
git push -u origin master // 注意:更改后,第一次上传需要指定 origin
如何将git的master分支整个替换为另外一个分支
方法一
如果blah分支bai能够du快速merge到master分支,那么采用这个方法zhi
git checkout seotweaks
git merge -s ours master
git checkout master
git merge seotweaks
方法二
如果分dao支合并时出现了冲突zhuan,而shu你的remote仓库是github或者bitbucket,那么只能强上了
(使用git branch -m命令可以对已经存在的branch重名了)
git branch -m master old-master
git branch -m seotweaks master
git push -f origin master