简体   繁体   中英

git p4 with existing changes

I have an existing perforce project with some changes, is it possible to set it up with git? Ideally I'd like to diff the changes I've made with master\\p4, as the p4 diff command does not seem to be working.

I've tried:

git init
git p4 sync //path/to/my/project

After doing this git diff does not show my local changes.

I've tried doing a git p4 clone //path/to/my/project on a copy of my project, but that overwrites my changes. There are enough files in the changeset that I'd like to avoid having to copy over each changed file to the cloned git project.

Maybe there is a better way, but this seems to work ok:

git p4 clone //path/to/my/project

cp -R ~/path/with/changes/* cloned-version/

The only downside, is that renamed files don't show up this way because they are viewed as an add.

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