git - How to have a separate branch for tagged commits only? -
i tasked organize repository in way aside other branches there dedicated branch, store commits of released version. below simplified scheme of achieve:
| trunk | | releases | |----------+-----------+----------| | commit 1 | | | | commit 2 | v0.1 ---> | tag 1 | | commit 3 | | | | commit 4 | | | | commit 5 | | | | commit 6 | v0.2 ---> | tag 2 | | commit 7 | | | | commit 8 | | | | commit 9 | | |
this little bit advanced me now, i'd appreciate guidance on how that! i'm not sure on how able have second tag in "releases" branch w/o having import intermediate commits. possible @ all?
also, if have better scheme achieving same goal (the goal being have dedicated branch releases only), please not hesitate advise!
that wouldn't make sense, since tagged commits represents state of branch, composed of commits , predecessors.
isolate tagged commits write different history, since commits miss ancestors: sequence of said ancestors plus tagged commits leads code base particular state.
the simpler approach make sure tag release commits in 1 dedicated branch (master instance).
then, simple git show-ref --tags
can list comimts referenced tags.
or can create branch of tags (for bug fixing release)
git checkout -b newbranch v1.0
and can deduce last release tag commit (git describe --long
).
the op wvxvw adds in comments:
but branch releases store history of special commits (the tagged ones) made it, , point other branches being sources commits came from
that possible merging tag commit in "release branch", a merge keeps "theirs" (ie source of merge, meaning source of tagged commit)
--x--x--x--x--x--x--x (v1) (v2) \ \ ----y--------y--
Comments
Post a Comment