Skip to content
Tomáš Kapin edited this page Nov 2, 2023 · 5 revisions

Git

Generic commands

Git log (A DOG)

git log --all --decorate --oneline --graph

Git log (oneline with committer and relative date)

git log --all --decorate --format="%C(auto) %h %d %s %Cblue(%cn, %cr)%Creset" --graph

Git create global alias

git config --global alias.ll 'log --graph --all --decorate --oneline'

Content of .profile

function tc() { start /C/totalcmd/TOTALCMD64.EXE //O //L "$(pwd -W)" //P=L; }

cd /c/_main/git

Create branch

git branch <branch-name>
git branch --list
git checkout <branch-name>

Create and checkout branch

git checkout -b <branch-name>

Push branch with upstream

git push --set-upstream origin <branch-name>

Setting up a new forked repo (e.g., from dotnet)

gh repo clone <repo>
# set upstream to no-push
git remote set-url --push upstream no_push
# rename origin and upstream
git remote rename upstream dotnet
git remote rename origin tkapin

Clone this wiki locally