Git Diff to Perforce?

We have a Perforce repository and we later switched to Git. Still we have a release branch that is in perforce and now, I need to apply some of the git commits to the perforce branch.

According to what I have read, it seems this can be done by doing a git diff, creating a patch and then applying to the perforce code base. But, I have seen any concrete example. Could anyone help me on this? Thanks.

  • Is there a way for git to checksum a repository for sanity?
  • The authenticity of host can't be established
  • will creating a git branch delete my local changes
  • Git remove directory
  • Why does Git convert CRLF to LF on Linux?
  • Tracking remote branch - when to do it?
  • having a branch for live and development using git on server
  • unable push modified content
  • No newline at end of file
  • How to use Kaleidoscope 2 with Git Tower?
  • .gitignore /folder vs folder/
  • cloning from github when password has ! in it
  • One Solution collect form web for “Git Diff to Perforce?”

    You can form a patch from git history with a simple git diff <point1>..<point2> > the_diff.patch and then apply that patch to your working tree using patch -p1 <the_diff.patch and commit the changes to perforce.

    Also you could form a sequence of git commits as separate patch files using git format-patch <point1>..<point2> and apply them sequentally if you wish.

    There’s git-p4 tool to import/export commits from/to git and perforce repositories, but I haven’t use it so far.

    Git Baby is a git and github fan, let's start git clone.