git p4 sync - where did the perforce changes go?

2k views Asked by At

In my current setup, all changes made in a Perforce depot are migrated to a git repo. The transfer is one way, always from Perforce to git, and never the other way around. I had no problem using git p4 clone to copy the depot into a new git repo, however, I'm now attempting to use git p4 sync, and my repo is not being updated.

When I ran git p4 sync, it did show status messages on importing new changes from the Perforce depot. If I run the command again, it says everything is up-to-date. My master branch does not have the changes, and there aren't any other branches or remotes listed in my repo (eg with git branch -v and git remote -v. How do I checkout these changes?

(using git version 2.3.2 (Apple Git-55)).

3

There are 3 answers

3
MuertoExcobito On BEST ANSWER

Apparently there is an implicit remote branch "p4" created. Thus, running git pull p4/HEAD will pull the latest changes from git p4 sync into your current branch. It can be listed by using git branch --remotes (thanks to @jamesdlin).

2
Luke On

You want this:

$ git p4 rebase

0
Sridhar Sarnobat On

This unexpectedly worked for me:

git reset --hard p4/master

Presumably you still have to run git p4 sync first.

I know this isn't ideal if you actually have changes you want to be retained.