更新git操作2
This commit is contained in:
12
README.md
12
README.md
@@ -3,20 +3,20 @@
|
|||||||
线上部署gitea
|
线上部署gitea
|
||||||
|
|
||||||
### 关联线上库
|
### 关联线上库
|
||||||
- git remote add profile https://gitea.vlos.net/jafar.o.jeh/gitea_init.git
|
- git remote add <项目代号/名字:自定义> https://gitea.vlos.net/jafar.o.jeh/gitea_init.git
|
||||||
- git pull profile main
|
- git pull <项目代号/名字:自定义> main
|
||||||
### 更新线上库
|
### 更新线上库
|
||||||
- git add .
|
- git add .
|
||||||
- git commit -m "更新信息"
|
- git commit -m "更新信息"
|
||||||
- git push profile main
|
- git push <项目代号/名字:自定义> main
|
||||||
|
|
||||||
### 合并分支,合并dev->main
|
### 合并分支,合并dev->main
|
||||||
- git checkout main #切换到 main 分支
|
- git checkout main #切换到 main 分支
|
||||||
- git merge dev #令将分支dev合并到 main 分支
|
- git merge dev #令将分支dev合并到 main 分支
|
||||||
- git merge --continue #解决合并冲突(如果需要)
|
- git merge --continue #解决合并冲突(如果需要)
|
||||||
- git add . && git push profile main # 正常更新main分支到线上
|
- git add . && git push <项目代号/名字:自定义> main # 正常更新main分支到线上
|
||||||
|
|
||||||
### 远程文件强制覆盖本地
|
### 远程文件强制覆盖本地
|
||||||
- git fetch profile
|
- git fetch <项目代号/名字:自定义>
|
||||||
- git checkout your-branch-name # 确保你在正确的分支上
|
- git checkout your-branch-name # 确保你在正确的分支上
|
||||||
- git reset --hard profile/your-branch-name # git reset --hard profile/master
|
- git reset --hard <项目代号/名字:自定义>/your-branch-name # git reset --hard <项目代号/名字:自定义>/master
|
||||||
|
|||||||
Reference in New Issue
Block a user