Git Snippets

Configuration

Global Settings

$ git config --global user.name "Bob.Smith"
$ git config --global user.email "bob@example.com"
$ git config --global core.editor nano
$ git config --global merge.tool meld

Lists repo config settings

$ git config -l

Show repo username

$ git config user.name

Set repo username

$ git config user.name "Bob.Smith"

Remotes

Show repo remotes

$ git remote -v

Rename remote from origin to github

$ git remote rename origin github

Add a remote

$ git add remote github

Misc

Importing a project

$ cd /project/directory
$ git init

Take Snapshot of curent files

$ git add .

Leave a Reply