Skip to content

Instantly share code, notes, and snippets.

@FoxNeo
Last active July 19, 2024 09:50
Show Gist options
  • Save FoxNeo/27bf0e84b34ebddb2eea31d46eeb03ed to your computer and use it in GitHub Desktop.
Save FoxNeo/27bf0e84b34ebddb2eea31d46eeb03ed to your computer and use it in GitHub Desktop.
Command to sign commit or other configuration

Git commands

show global confg

$ git config --global --list

sign commits local repository

$ git config commit.gpgsign true

sign commits global repository

$ git config --global commit.gpgsign true

Change default editor to nano

$ git config --global core. editor "nano"

Reset branch to origin state

$ git reset --hard [hash]
$ git reset --hard HEAD

Show logs with reflog

$ git reflog

Ammend commit

$ git commit --ammend

show short logs

$ git shortlog
$ git shortlog -sn

show logs with graph

$ git log --graph
$ git log --oneline

config logs in global

$ git config --global alias.stats "shortlog -sn --all --no-merges"

git blame example

git blame file.txt
git branch -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment