![]() ![]() gitignore (perĭirectory) and $GIT_DIR/info/exclude, but do still use the ignore If the Git configuration variable clean.requireForce is not set toįalse, git clean will refuse to run unless given -f, -n or -i.ĭon’t use the standard ignore rules read from. If clean.requireForce is set to "true" (the default) in your configuration, one needs to specify -f otherwise nothing will actually happen.Īgain see the git-clean docs for more information. Note the case difference on the X for the two latter commands. To remove ignored and non-ignored files, run git clean -f -x or git clean -fx.To remove ignored files, run git clean -f -X or git clean -fX.To remove directories, run git clean -f -d or git clean -fd.Step 1 is to show what will be deleted by using the -n option: # Print out the list of files and directories which will be removed (dry run)Ĭlean Step - beware: this will delete files: # Delete the files from the repository arguments are given, only those paths are affected. This can, for example, be useful to remove all build products. Normally, only files unknown to Git are removed, but if the -x option is specified, ignored files are also removed. Git-clean - Remove untracked files from the working tree Synopsis git clean …Ĭleans the working tree by recursively removing files that are not under version control, starting from the current directory. $LOCALAPPDATA/Perforce/p4merge.exe), git does not seem to be expanding environment variables for paths (if you know how to get this working, please let me know or update this answer) Even better would have been to take advantage of an environment variable (e.g. ![]() ![]() Although ~ should expand to current user's home directory (so in theory the path should be ~/AppData/Local/Perforce/p4merge.exe), this did not work for me.The above is an example path when p4merge was installed for the current user, not system-wide (does not need admin rights or UAC elevation).If it was listed as valid, you have to define in addition to merge.tool: git config -global c:/Users/my-login/AppData/Local/Perforce/p4merge.exe If p4merge was listed as available, it is in your PATH and you only have to set merge.tool: git config -global merge.tool p4merge You should see p4merge in either available or valid list. You can display list of supported tools by running: git mergetool -tool-help note that by default Perforce will add its installation dir to PATH, thus no need to specify full path to p4merge in the commandĪs pointed out by Pakosz, latest msys git now "natively" supports p4merge (tested on 1.8.5.2.msysgit.0).added double quotes for all file names so that files with spaces can still be found by the merge tool (I tested this in msys Git from Powershell).the custom tool config value resides in "mergetool.cmd", not "merge.cmd" (silly me, spent an hour troubleshooting why git kept complaining about non-existing tool).valid for all git projects not just the current one The changes (relative to Charles Bailey): Or, from a windows cmd.exe shell, the second line becomes : git config -global "p4merge.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"" To follow-up on Charles Bailey's answer, here's my git setup that's using p4merge (free cross-platform 3way merge tool) tested on msys Git (Windows) install: git config -global merge.tool p4merge ![]()
0 Comments
Leave a Reply. |