git只拉一个特定的标签

Vic*_*chi 3 git git-pull

我寻求命令让我的生活变得最简单.

问题: 有一个包含来源的项目.随着时间的推移,我推出了更多版本:v1.0.1直到v1.0.14(最新版本)版本v1.0.12是一个补丁并修复了myserver的特殊功能,但myserver实际上安装了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"
Run Code Online (Sandbox Code Playgroud)

Ada*_*zad 6

您需要使用git checkout来结帐您想要的标签。这将使工作目录与创建标签时的目录相同。


Vic*_*chi 5

我找到的解决方案是:

  1. $ git fetch -unf origin 1.0.12:refs/tags/1.0.12
  2. $ git checkout 1.0.12

如果远程更改想要与当前合并将使: $ git merger 1.0.12

请告诉我,我的方式是否正确