@ -43,9 +43,10 @@ unreleased) version of git, that is available from 'master'
@@ -43,9 +43,10 @@ unreleased) version of git, that is available from 'master'
branch of the `git.git` repository.
Documentation for older releases are available here:
* link:v1.6.0/git.html[documentation for release 1.6.0]
* link:v1.6.1/git.html[documentation for release 1.6.1]
* release notes for
link:RelNotes-1.6.1.txt[1.6.1],
link:RelNotes-1.6.0.txt[1.6.0].
* link:v1.5.6.5/git.html[documentation for release 1.5.6.5]
@ -497,7 +498,8 @@ other
@@ -497,7 +498,8 @@ other
'GIT_PAGER'::
This environment variable overrides `$PAGER`. If it is set
to an empty string or to the value "cat", git will not launch
a pager.
a pager. See also the `core.pager` option in
linkgit:git-config[1].
'GIT_SSH'::
If this environment variable is set then 'git-fetch'
git-p4 supports two main modes: Importing from Perforce to a Git repository is
done using "git-p4 sync" or "git-p4 rebase". Submitting changes from Git back
to Perforce is done using "git-p4 submit".
git-p4 can be used in two different ways:
1) To import changes from Perforce to a Git repository, using "git-p4 sync".
2) To submit changes from Git back to Perforce, using "git-p4 submit".
Importing
=========
You can simply start with
Simply start with
git-p4 clone //depot/path/project
@ -18,11 +20,18 @@ or
@@ -18,11 +20,18 @@ or
git-p4 clone //depot/path/project myproject
This will create an empty git repository in a subdirectory called "project" (or
"myproject" with the second command), import the head revision from the
specified perforce path into a git "p4" branch (remotes/p4 actually), create a
master branch off it and check it out. If you want the entire history (not just
the head revision) then you can simply append a "@all" to the depot path:
This will:
1) Create an empty git repository in a subdirectory called "project" (or
"myproject" with the second command)
2) Import the head revision from the given Perforce path into a git branch
called "p4" (remotes/p4 actually)
3) Create a master branch based on it and check it out.
If you want the entire history (not just the head revision) then you can simply
append a "@all" to the depot path:
git-p4 clone //depot/project/main@all myproject
@ -37,31 +46,40 @@ If you want more control you can also use the git-p4 sync command directly:
@@ -37,31 +46,40 @@ If you want more control you can also use the git-p4 sync command directly:
This will import the current head revision of the specified depot path into a
"remotes/p4/master" branch of your git repository. You can use the
--branch=mybranch option to use a different branch.
--branch=mybranch option to import into a different branch.
If you want to import the entire history of a given depot path just use
If you want to import the entire history of a given depot path simply use:
git-p4 sync //path/in/depot@all
Note:
To achieve optimal compression you may want to run 'git repack -a -d -f' after
a big import. This may take a while.
Support for Perforce integrations is still work in progress. Don't bother
trying it unless you want to hack on it :)
Incremental Imports
===================
After an initial import you can easily synchronize your git repository with
newer changes from the Perforce depot by just calling
After an initial import you can continue to synchronize your git repository
with newer changes from the Perforce depot by just calling
git-p4 sync
in your git repository. By default the "remotes/p4/master" branch is updated.
It is recommended to run 'git repack -a -d -f' from time to time when using
incremental imports to optimally combine the individual git packs that each
incremental import creates through the use of git-fast-import.
Advanced Setup
==============
Suppose you have a periodically updated git repository somewhere, containing a
complete import of a Perforce project. This repository can be cloned and used
with git-p4. When updating the cloned repository with the "sync" command,
git-p4 will try to fetch changes from the original repository first. The git
protocol used with this is usually faster than importing from Perforce
directly.
This behaviour can be disabled by setting the "git-p4.syncFromOrigin" git