参考:
http://git-scm.com/book/en/Git-and-Other-Systems-Migrating-to-Git
http://stackoverflow.com/questions/15305357/how-to-clone-branch-with-git-p4
步骤:
- 下载 p4命令行工具
- cp p4 ~/bin
- chmod +x ~/bin/p4
- 设置环境变量
- export P4PORT=SERVER_NAME:PORT_NUMBER
- export P4USER=USER_NAME
- export P4PASSWD=PASSWORD
- export P4CHARSET=utf8
- 克隆到本地,如需带历史版本,后面加 @All
- git p4 clone //depot/...@all
- 设置git server地址
- git remote add origin git@192.168.1.203:p4/depot.git
- git push -u origin master