![]() ![]() The value of this variable is the command to invoke the merge tool (may specify a script for ease). When specifying a merge.tool value not in the supported list, also specify a mergetool.cmd matching variable. It’s free to use, and does not require using the Perforce server or a license, so anyone can use it.Īs an example, to configure it globally for all Git repos, execute: git config -global merge.tool p4merge Other Merge Tools One of my favorite merge tools is by Perforce: P4Merge. To configure the git merge tool, use: git config merge.tool Example The Git help lists them, and as of this writing they are: ![]() Git supports the easy configuration of many merge tools. Some, including Git, allow configuring your favorite merge tool vs forcing use of their own merge tool. To help with merges, source control products have a merge tool. Distributed version control systems open up lots of flexibility and provide lots of efficiency in work-flow than their centralized cousins (e.g.Git mergetool: Source merging is inevitable with concurrent development. There’s often value to use DVCS in the team. However, the case that I run into frequently is where there is a corporate standard for a deficient VCS, but the team wish to work efficiently by using a more powerful VCS. In that case, there are many successful stories of using multiple VCS: DVCS for local version control and committing to a shared centralized VCS with a DVCS-to-VCS bridge. Git is particularly good at this aspect which provides tons of bridges to other VCS (That’s another good reason for preferring Git over Mercurial :-)). Lately I have been using the git-p4 bridge to synchronize codes between a centralized Perforce repository and a local Git repository. This post is a tutorial on how to set this up. Setting up the Perforce command line client #Youtube p4merge how to# ![]() The git-p4 bridge requires the p4 command line client properly set up. There is a lengthy tutorial on Perforce’s documentation website. ![]() Install the p4 command line client (use MacPort or Homebrew if you are a Mac guy :-)).p4settings file in your home directory with the global environment settings for your Perforce repository. Ln -s git_source_path/contrib/fast-import/git-p4 /usr/bin/git-p4 For example, here is what my settings look like: bashrc, export P4CONFIG=/path/to/your/.p4settings. Instead of using “git merge” to merge local branches, use “git rebase”įor the last one, the reason is that when you run “git merge”, Git creates an extra commit on top of the stack for the merging.Instead of using “git pull” to fetch and merge changes from remote repository to local, use “git-p4 rebase”.Instead of using “git fetch” to fetch changes from remote repository to local, use “git-p4 sync”.Instead of using “git push” to push local commits to remote repository, use “git-p4 submit”.Commandsįour things to remember when using git-p4: Windows users need to include the git-p4.bat file in the system path. This is not something we wanna show in the remote non-git repository. Detailed explanation of the difference between git-merge and git-rebase goes here. Login with “p4 login” and clone a Perforce project.Here is an example almost covering daily usage: There is a detailed explanation on the usage of git-p4 in Git’s source. Gitignore file to ignore files that we don’t want to check into the remote repository for each project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |