Skip to content

Instantly share code, notes, and snippets.

@p1nox
Last active October 1, 2025 01:00
Show Gist options
  • Select an option

  • Save p1nox/2fee084bdd80098c2fe815fb7e6d8193 to your computer and use it in GitHub Desktop.

Select an option

Save p1nox/2fee084bdd80098c2fe815fb7e6d8193 to your computer and use it in GitHub Desktop.
git notes
# uncommit
git reset HEAD~

# remove submodules https://stackoverflow.com/questions/29850029/what-is-the-current-way-to-remove-a-git-submodule
git submodule deinit <asubmodule>    
git rm <asubmodule>
rm -rf .git/modules/<asubmodule>

# cherry-pick
git cherry-pick 000ccc
git cherry-pick -m 1 000ccc

# named clone
git clone https://github.com/sferik/sign-in-with-twitter.git signin

# default behaviour, pull is fast-forwarded if possible, otherwise it's merged
git config  --global pull.ff true

# generate new one
ssh-keygen -t rsa -C "your_email@example.com"

# meld mergetool
git config --global merge.tool meld

# set vim
git config --global core.editor "vim"

# others
git config --global user.name "Raul Pino"
git config --global user.email "pinox101@gmail.com"

chmod 700 ~/.ssh
chmod 600 ~/.ssh/config
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub

ssh -T git@github.com
ssh-add -K ~/.ssh/id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment