我正在寻找一条命令,以使我的生活更加轻松。
问题: 我有一个包含源代码的项目。 随着时间的推移,我推出了更多的版本:从v1.0.1到v1.0.14(最新版本)。 版本v1.0.12是我的服务器专门修补和修复的补丁, 但是该服务器实际上安装了v1.0.10(我应该从v1.0.10更新到v1.0.12)
问题: 如何创建一个命令来更新特定服务器到所需的版本v1.0.12?
我知道git pull命令,但不知道正确的使用方法,还希望有一些选项来防止合并冲突。
这是我创建的命令的起点:
$ git pull --rebase origin refs/tags/1.0.13:refs/tags/1.0.13
From http://192.168.0.12/gitlab/AF-NG/frontend-dist
* [new tag] 1.0.13 -> 1.0.13
* [new tag] 1.0.11 -> 1.0.11
* [new tag] 1.0.12 -> 1.0.12
* [new tag] 1.0.14 -> 1.0.14
First, rewinding head to replay your work on top of it...
Applying: 2.0.0
Using index info to reconstruct a base tree...
------
Falling back to patching base and 3-way merge...
Auto-merging styles/css/production.min.css
CONFLICT (add/add): Merge conflict in file.css
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort"
git pull
的意思是先执行git fetch
,然后再运行第二个 Git 命令,通常是git merge
,但你也可以告诉它使用git rebase
。我建议避免使用git pull
。只需使用git fetch
,然后跟上你想要的命令,这种情况下似乎是git checkout
。 - torekgit pull origin master:1.0.13
- Sam