Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git pull a specific tag only

Tags:

git

git-pull

I looking for command to make my life easiest.

The issue: have a project with sources. along of time i pushed more versions: v1.0.1 until v1.0.14 (latest) the version v1.0.12 is an patch and fixes special for myserver, but the myserver actually have installed v1.0.10 (I should update from v1.0.10 to v1.0.12)

the question: how to make an command to update the specific server to the looking version v1.0.12

i know command git pull but not understand how to do correct way also i want some options to prevent merge conflicts

the start point is command that i made:

$ 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"
like image 744
Victor Orletchi Avatar asked Mar 16 '17 16:03

Victor Orletchi


2 Answers

the solution that I find is:

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

if remote changes wants to merge with current will make a: $ git merger 1.0.12

please tell me if my way is right

like image 70
Victor Orletchi Avatar answered Nov 20 '22 13:11

Victor Orletchi


You need to use git checkout to checkout the tag you want. This will make the working directory the same as it was when you created the tag.

like image 28
Adam Nierzad Avatar answered Nov 20 '22 14:11

Adam Nierzad