commands

Post Reply
dev
Site Admin
Posts: 61
Joined: 09 Mar 2021, 17:52

commands

Post by dev »

gitconfig location:

Code: Select all

Win:
C:\Users\username\.gitconfig

Linux:
~home/<username>/.gitconfig or ~root/.gitconfig


Set difftool to .gitconfig

Code: Select all

[diff]
    tool = winmerge
[difftool "winmerge"]
    cmd = "'C:/Program Files (x86)/WinMerge/WinMergeU.exe'" -e "$LOCAL" "$REMOTE"

Code: Select all

git config --global user.name “Your Name”
git config --local user.name “Your Name”

git config --global user.email “you@example.com”
git config --global alias.adog "log --all --decorate --oneline --graph"
git config --global alias.lg "log --pretty='%C(yellow)%h%Creset %s %Cgreen%cr%Creset %C(yellow)[%an]%Cred%d'"

git config --global pull.ff only -> fetch and mege only when fastforward merge is possible

Code: Select all

git clone
git init
git status
git stash
git stash list
git stash pop
git stash drop
git log
git log --oneline
git log --all --decorate --oneline --graph

Code: Select all

git branch <new-branch-name>
git branch --list <autocomplete>
git branch --merged master
git branch --no-merged master
git branch -m <old-branch-name> <new-branch-name>
git branch -r (list remote branches)
git checkout <branch-name/commit>
git checkout -b <branch-name> 

Code: Select all

git diff (working tree <-> staging area)
git diff --staged (staging area <-> local repository)
git diff <commit> (working tree <-> local repository)
git diff.png
git diff.png (158.59 KiB) Viewed 4424 times







git-config-file-locations.png
git-config-file-locations.png (29.03 KiB) Viewed 4427 times
Post Reply