12

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" 
6
  • Do you want to checkout v1.0.12 on some server? Or do you want to integrate v1.0.12 with your local non-pushed/shared commits? Commented Mar 16, 2017 at 16:08
  • I looking for command to make my life easiest. Aren't we all? Commented Mar 16, 2017 at 16:28
  • 1
    git pull means git fetch and then run a second Git command, usually git merge although you can tell it to use git rebase instead. I recommend avoiding git pull. Just use git fetch followed by the command you want, which in this case seems to be git checkout. Commented Mar 16, 2017 at 16:32
  • Lasse V. Karlsen: I want to integrate v1.0.12 with your local non-pushed/shared commits Commented Mar 16, 2017 at 16:33
  • I never use git fetch until now (use only git pull from IDE), and I unknown correct flow to run commands, step by step. your support will be appreciable. tx Commented Mar 16, 2017 at 16:36

2 Answers 2

11

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

Sign up to request clarification or add additional context in comments.

1 Comment

Would be helpful if you included why you would use -unf for your fetch. I've read the man page for these flags but it would make this answer more complete as to why you are using these 3 flags. I understand why -no-tags, I slightly understand --force for the refspec part (maybe), but not sure on the --update-head-ok option.
6

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.