简体   繁体   中英

How to move new commits from git-p4 to a different repo

I am using git p4 clone //depot/...@all. to initially get source from perforce to a local git repo. I push it to remote. I then periodically use git p4 rebase //depot/... . to get the latest code to the local git repo. Push it to remote.

Because of the size of our history I am truncating the history and creating a "current_src" repo on remote which has limited history. I use rebase for this so the commit hashes no longer match with what I pushed from my local repo.

Now when I push newly retrieved source from git-p4 to this remote "current_src" I get a ton of conflicts.

Is there a way I can automate the push of only new source from git-p4 to the remote current_src which has different commit hashes due to the rebase?

Just for the sake of context this is how I truncate history: Splitting a git repo at a commit hash and merge it later

As explained in Git p4 , you could, for each new Perforce revision, create a git-p4 shallow clone which creates a new Git repository with only the very latest Perforce revision imported into it.

That would be a way to "split your Git repository history": leave your old repository intact, and start a new one.

Try and use that new Git repository for the next few git p4 rebase //depot/... and see if you have conflicts then.

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