Extending `git-p4` clientspec after initial clone

后端 未结 2 772
野性不改
野性不改 2020-12-15 12:51

After doing a git-p4 clone --use-clientspec, I would like to add an extra entry to the clientspec, and import the current state of the added entry to my Git rep

2条回答
  •  温柔的废话
    2020-12-15 13:14

    @jamesdlin's answer is what worked for me. While researching ideas for how to solve this, I came across a couple other stackoverflow answers that were interesting. I wonder if they could be combined to create an elegant solution. I'm mentioning the idea here in case it helps someone else. This idea is a variation of what's described in How to copy commits from one Git repo to another? and borrows an idea from git clone multiple p4 paths in one git repo.

    1. Start with p4 client Pa, which is mirrored into git repo Gb. Take the set of paths that you add to client Pa, and create a new p4 client Pb that maps only those paths.
    2. Next create a new git repo Gb that clones p4 client Pb. The git repo Gb can be created in a any temporary location, and it will be thrown away when done. git p4 clone newstuff ...etc...
    3. Back in Ga, add a new remote to Gb. git remote add newstuff /path/to/newstuff
    4. Follow the remaining instructions from How to copy commits from one Git repo to another?. Use cherry-pick like in those instructions. Or use git merge, with --allow-unrelated-histories if needed.

提交回复
热议问题