How to clone branch with git-p4?

git-p4 clone multiple depot paths
git p4 clone with history
git-p4 install
git-p4 windows
git-p4 clone without history
git-p4 streams
git-p4 python 3
maybe git-p4 is broken

I did:

git p4 clone //depot/path/to/project/trunk/@all project

to create the master branch of project. Now I want to clone //depot/path/to/project/release to the release branch of project. How is that done?

UPDATE: Using --detect-branches doesn't work, either. It reports that it's updating two branches (when there are really three branches) but git branch reports only master exists.

How to clone branch with git-p4?, Here are my setup notes from when I was using git-p4. It might be helpful: Download the p4 linux client. Store the file in ~/bin or /usr/local/bin� How to Clone Git Branches. While you can clone repositories with the git clone command, keep in mind that this clones the branch and the remote HEAD. This is usually master by default and includes all other branches in the repository. So when you clone a repository, you clone the master and all other branches. This means you will have to

I believe "detect branches" relies on you having a branch mapping with the same name as the branch path in your depot. If that is not the case, you probably need to use the suggested method of defining the git-p4.branchList config value in an empty git repo before running the git-p4 clone command.

Git-P4: Working with Git and Perforce, The branch p4-integ is synchronized with the real P4 repository using a fast-sync git p4 clone //depot/path/project@<earlier-cutoff-point>,<latest-changelist>. git clone command is used to clone branches and git repositories. In this tutorial, we will learn how to clone a git branch in different ways. We will learn clone single branch, clone to a specific folder, clone specific tag etc in this tutorial. List Branches. We will start by listing branches. In order to copy branch, we need to list the

Horribly late answer, but there's so little documentation on git-p4 that I hope it's still useful.

I also struggled to add branches to an existing repository, and never got the detect-branches magic to work with branch mappings.

I had a little more success doing it in stages manually, explicitly telling git-p4 which path to import and using the --branch option. I believe I also manually created the release branch in the existing repository before running that.

For this question, that would be git p4 sync //depot/path/to/project/release --branch=release

I believe this would work using clone too, as clone is mostly just sync behind the scenes in the git-p4 code, but once you already have a repository, I think sync would be safer.

git-p4(1), The command git p4 rebase does a sync plus rebases the current branch onto the updated p4 remote branch. EXAMPLES. Clone a repository: $ git p4 clone //� git p4 clone --destination=/path/to/new/git/tree //depot/path1 //depot/path2 If you want to use exclusions or if you want to adjust how Perforce depot paths are mapped to local paths, you will need to add the --use-client-spec option.

Git-P4: tool to import/export files from/to Helix server, Part 1., usage: /usr/libexec/git-core/git-p4 <command> [options] valid commands: clone, rollback, debug, commit, rebase, branches, sync, submit git-p4.branchUser . One phase in branch detection involves looking at p4 branches to find new ones to import. By default, all branches are inspected. This option limits the search to just those owned by the single user named in the variable. git-p4.branchList . List of branches to be imported when branch detection is enabled.

Git-P4: tool to import/export files from/to Helix server, Part 2., Note: The git p4 clone --use-client-spec command line option restricts Performing incremental import into refs/remotes/p4/master git branch� However, when I use git-p4 to clone "project", all 3 branches are not considered as branches and all get cloned into the single master branch. This is how I'm invoking git-p4: git-p4 clone --detect-branches //depot/project

Documentation/git-p4.txt - external/msysgit/git, 'git p4 rebase' does a sync plus rebases the current branch onto. the updated p4 remote branch. EXAMPLE. -------. * Clone a repository: +. ------------. $ git p4� After this what git p4 will do is to scan every branch to arrive on this branch , which is obviously extremely time consuming and it would appear to be non-responsive. So one important tip is to tell git p4 to restrict search to a specific user using config option.

Comments
  • You're missing --add in the second git config --add git-p4.branchList main:dev
  • Ah, this makes sense. I was wondering how the branch detection 'magic' worked. I'll give this a try. Thanks.
  • This is still not working for me. I suspect merges have gone in both directions on at least some of our branches and it's throwing a wrench into the works of git-p4.
  • It's worked for me in the past on a very large repo, with someone of most confusing branches/merging I've ever seen. Since the git-p4 is written in python, its actually not that hard to debug.