2021-01-21

简易的命令行入门教程:
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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值