Skip to content

Instantly share code, notes, and snippets.

@yywill
Created July 27, 2012 07:58
Show Gist options
  • Save yywill/3186730 to your computer and use it in GitHub Desktop.
Save yywill/3186730 to your computer and use it in GitHub Desktop.
GIT: create a new branch and syn with remote
#!/bin/sh
BRANCH=${1}
git init
git add .
git branch $BRANCH
git checkout $BRANCH
git remote add origin git@github.com:yywill/code_trash
git push origin $BRANCH
# git prety print
# using "git lg"
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment