This process use Git-p4 as an import tool. Please follow below steps:-
- Install Python, Perforce client, Git bash on your machine.
- Download python script (git-p4.py) from given location@ https://raw.githubusercontent.com/git/git/master/git-p4.py
- Set following environment variables:-
P4PORT=public.perforce.com:1666
P4USER=testgitp4
- Run following command to import P4 project supplying project depot path on Perforce server and the path into which you want to import project.
Importing from //depot/myproject@all into /e/git/myproject
$ git init
Initialized empty Git repository in /private/tmp/p4import/.git/
Import destination: refs/remotes/p4/master
Importing revision 2153 (100%)
- Chand directory to /e/git/myproject
- At this point you’re almost done. If you run git log, you can see your imported work.
commit 33ddd3a8c5c1eda6eace15be3sss3c318b32c39
Author: git p4 <git@p4test.com>
Date: Tue Oct 30 03:08:07 2012 -0500
- Updated templates.
[git-p4: depot-paths = "//depot/myproject": change = 310]
commit 49a02a40721d88b9f878c719d3e8a3be91398744
Author: git p4 <git@p4test.com>
Date: Tue Oct 16 07:14:39 2012 -0500
- Updated file.
[git-p4: depot-paths = "//depot/myproject": change = 311]
- Upload imported files to Git
$ git init
$ git remote add origin ssh://user@server:8022/path/some_git_project.git
$ git remote –v
$ git remote –v
$ git push -u origin development
Comments
Post a Comment