简体   繁体   中英

git-p4 and detached branches

So, I do a

git config git-p4.branchList foo/bar:baz/garply
git init
git p4 sync //depot/foo/bar
git p4 sync --branch=baz/garply //depot/baz/garply

When all was said and done, I was hoping that there would be relationship between foo/bar (the master branch) and baz/garply (the branch off of the master branch). There wasn't.

I am able to git checkout master and I correctly land in the master branch. But, when I try to switch to "baz/garply" git checkout p4/baz/garply , I land in a detached HEAD. ( git diff master from this detached HEAD also seems to result in very incorrect results.)

I assume that git-p4 does not maintain relationships primarily through the branchList mechanism? Is there a way to establish this relationship between the branches?

(Note that I am doing git sync rather than git clone because of the repositories are huge and I'd rather not check them out again. Also, the detect-branches mechanism won't work because the repository is too large.)

I wish I had an answer for you that actually works, because I need one too.

I edited .git/info/grafts to have a line like this:

HASH1 HASH2

in which HASH1 is the first commit on the garply branch, and HASH2 was garply's parent on master.

Problem is that now I can't git p4 sync or git p4 submit and have it actually work.

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