heihachi88
11/26/2014 - 5:45 AM

Git config

Git config

# if you forgot to add file/dir in to .gitignore after push
git rm --cached readme.txt

# revert local commits
git reset --hard remotes/origin/HEAD

# show all branches
git branch

# create new branch
git branch branchname

# use certain branch
git checkout master
# set name and email
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com

# check global config
git config --list

# switch remote to ssh
git remote set-url origin git@github.com:USERNAME/REPOSITORY2.git