git config --global diff.tool meld
git config --global difftool.meld.path "C:\Program Files (x86)\Meld\Meld.exe"
git config --global difftool.prompt false
git config --global merge.tool meld
git config --global mergetool.meld.path "C:\Program Files (x86)\Meld\Meld.exe"
git config --global mergetool.prompt false
(Update the file path for Meld.exe if yours is different.)
git config --global diff.tool meld
git config --global difftool.meld.path "/usr/bin/meld"
git config --global difftool.prompt false
git config --global merge.tool meld
git config --global mergetool.meld.path "/usr/bin/meld"
git config --global mergetool.prompt false
$ git stash (Push changes on to stack)
$ git stash apply (Pop changes from stack)
$ git revert <commit>
To revert a merge:
$ git revert -m 1 <hash>
$ export EDITOR="$VISUAL"
$ export VISUAL=vim
$ git log.
* df71a27 - (HEAD feature_x) Updated CSS for new elements (4 minutes ago)
* ba9dd9a - Added new elements to page design (15 minutes ago)
* f392171 - Added new feature X (1 day ago)
* d7322aa - (origin/feature_x) Proof of concept for feature X (3 days ago)
$ git rebase -i HEAD~3
pick f392171 Added new feature X
squash ba9dd9a Added new elements to page design
squash df71a27 Updated CSS for new elements
$ git push origin <branch> -f
$ git checkout floating-pt-warn
$ git rebase origin/master
$ git clone https://github.com/Mehul2802/pmacct.git
$ git remote add upstream https://github.com/pmacct/pmacct.git
$ git remote -v
$ git pull upstream master
$ git push origin master
$ git remote show origin
$ git diff rev1 rev2 > patch.diff
$ git apply patch.diff
$ git ls-files --deleted -z | xargs -0 git rm
$ git tag v1.0 ec32d32
Where v1.0 is the tag name and ec32d32 is the commit you want to tag
Once done you can push the tags by:
$ git push origin --tags
git commit --amend -m "New commit message."
git push origin <branch_name> -f
$ git checkout -b new-feature
$ git commit -m "fast forward"
$ git checkout master
$ git merge new-feature
$ git branch -d new-feature
- The way you git ignore watching/tracking a particular dir/file. you just run this:
$ git update-index --assume-unchanged <file>
- To get undo/show dir's/files that are set to assume-unchanged run this:
git update-index --no-assume-unchanged <file>
- To get a list of dir's/files that are assume-unchanged run this:
git ls-files -v|grep '^h'
git config --global diff.tool meld
svn diff --diff-cmd='meld'