![git config p4merge git config p4merge](http://larrynung.github.io/2017/09/19/P4Merge-Use-P4Merge-as-git-mergetool/1.png)
Now git hist will work as git log -graph -oneline -decorate -all.Example: git config alias.hist "git log -graph -oneline -decorate -all".Note: Make sure your editor of choice is listed in your environment variablesĪliases: Shorten long commands into an abbreviation of your choice.git config -global core.editor "notepad++.exe -multiInst -nosession".You can also use git checkout -b commit to create a branch off of a previous commit.Unlike git reset, git revert makes a new commit keeping your commit history intact. A more friendly way to remove changes than git reset is git revert commithash, which will find all the changes made in a previous commit and remove them while keeping all the work in between.However, it is bad practice to reset commits that have already been pushed to the public repository. If you want to reflect the reset in your working files as well use git reset commithash -hard.This will effectively uncommit a change in your local repository, but won't change your working files. git reset HEAD~ x where x is the number of commits to backtrack to or git reset commithash.Reset, Revert, Checkout for undoing mistakes To rebase your branch: git rebase master.Instead of fixing conflicts when you merge two branches, you can rebase the branch you are working on before you merge so that you can have a clean merge later on.When there are no more conflicts, git merge nameofbranch will work.By clicking save, the document will reflect each decision you made when choosing winners. Next to each conflict, click on which branch should win.p4merge will show a three-way comparison between branchA, branchB, and their common ancestor.During conflicts, enter git mergetool and p4merge will run automatically (after following the procedure in the section).
#GIT CONFIG P4MERGE DOWNLOAD#
![git config p4merge git config p4merge](https://practicalseries.com/1002-vcs/01-pages/03-04-install/02-images/fig-03-37.png)
Do some work on your new branch, and add and commit changes.Confirm you are on the new branch by using git branch -list, the one with an asterisk next to it is the branch you are currently on. Alternatively, use git checkout -b nameofbranch to create and checkout the branch at the same time. To do this, use git branch nameofbranch, then git checkout nameofbranch to switch to that branch.It is best practice to branch off of the master branch to work on stuff and then merge the two back together.There must be a space after the # sign for it to work. For example '# Introduction' will create a large heading. In markdown, pound signs denote headings or titles.md stands for markdown which is a markup language. ReadMe files in Git use the extension.
#GIT CONFIG P4MERGE WINDOWS#
This guide works well with bash but the git commands work in Windows cmd as well.