简体   繁体   中英

How can I merge my changes to a Tag in Git?

I am on Master Branch as seen above:

koraytugay$ git branch -a
  EBT-7869
  ebt-7911-cross-client
* master

And I have 5 changes but I want to merge only 2 of the files into a different tag.

koraytugay$ git tag
3.1.8
3.2.0

How can I merge only 2 files (Lets say A.java and B.java) to 3.2.0 tag?

Check out a new branch based on 3.2.0, merge the update, and tag the merge as 3.2.1

$ git checkout -b bugfix 3.2.0
$ git checkout master A.java B.java
$ git add A.java B.java
$ git commit
$ git tag 3.2.1

When you commit, make sure you describe what the changes are and why they are being made).

You might need to replace the checkout of A.java and B.java with something more complicated (like using git cherry-pick ) depending on what exactly you need to bring in from master .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM