git bundle: bundle tags and heads

好久不见. 提交于 2019-12-17 05:11:49

问题


I develop on several machines. I want to have a repository for each of my projects on each development machine, and I would like to keep them in sync without using a remote repository I can push to. (For now I cannot afford a dedicated machine for that purpose).

I think git bundle is the right tool for the job. I simply bundle my repo when I am done working on machine A, and unbundle on machine B. This leaves me with this questions:

Is it possible to embed information about tags and branches in the bundle? In particular, how can I bundle tag objects?

EDIT: Just a note aside - I want to keep this workflow as automated as possible. I do not want to treat the bundle as a remote. Rather than that, I would like to duplicate the bundle into my repository - that is add commits and tags, fast-forward existing branches and add new branches if the branch does not exist.


回答1:


git bundle create RA.bundle --branches --tags

would include informations about all tags and all branches.

git bundle takes a list of arguments, acceptable to git rev-parse and git rev-list (and containing a named ref, see SPECIFYING REFERENCES), that specifies the specific objects and references to transport.

--branches[=<pattern>]

Pretend as if all the refs in refs/heads are listed on the command line as <commit>.
If <pattern> is given, limit branches to ones matching given shell glob.
If pattern lacks ?, , or [, / at the end is implied.

--tags[=<pattern>]

Pretend as if all the refs in refs/tags are listed on the command line as <commit>.
If <pattern> is given, limit tags to ones matching given shell glob.
If pattern lacks ?, , or [, / at the end is implied.



来源:https://stackoverflow.com/questions/5719369/git-bundle-bundle-tags-and-heads

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!