MuertoExcobito
MuertoExcobito

Reputation: 10039

git p4 sync - where did the perforce changes go?

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)).

Upvotes: 2

Views: 2143

Answers (3)

Sridhar Sarnobat
Sridhar Sarnobat

Reputation: 25246

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.

Upvotes: 0

Luke
Luke

Reputation: 609

You want this:

$ git p4 rebase

Upvotes: 8

MuertoExcobito
MuertoExcobito

Reputation: 10039

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).

Upvotes: 0

Related Questions