Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in DevOps and Agile by (29.3k points)

I've got two branches that are fully merged together.

However, after the merge is done, I realise that one file has been messed up by the merge (someone else did an auto-format, gah), and it would just be easier to change to the new version in the other branch, and then re-insert my one line change after bringing it over into my branch.

So what's the easiest way in git to do this?

1 Answer

0 votes
by (50.2k points)

Let’s resolve the issue with an example

git tag -a v1.2 9fceb02 -m"Message here"

Where 9fceb02 is the beginning part of the commit id. You can then push the tag using 

git push origin v1.2

You can do a git log to show all the commit IDs in your current branch.

Warning: This creates tags with the current date

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...