title: Git output: denny.html
--
--
-
SITCON 2013, 2014 總召
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
- 註冊 GitHub 帳號
- 確認已安裝 Git
- 在 Terminal 輸入
git
確認 sudo apt-get install git
sudo yum install git
- 在 Terminal 輸入
- 選擇輔助武器 - 編輯器 (vim, emacs, gedit)
--
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git config --global color.ui true
git config --global core.editor vim
--
git config --global alias.co commit
git config --global alias.lg "log --color --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-
git add README.md
-
git add .
--
--
git reset <file>
--
--
-
git status
-
git diff
-
git diff --cached
--
-
git commit
-
git commit -m "first commit"
--
--
--
--
--
--
-
git log
-
git show <revisions>
--
--
--
git rm <file>
git rm --cached <file>
--
git mv <file>
--
--
git checkout <revision>
git checkout <revision> <file>
--
-
git stash
-
git stash save "message"
-
git stash list
-
git stash pop
-
git stash show -p <revision>
--
-
git reset <revision>
-
git reset --hard <revision>
--
git revert <revision>
--
--
-
git remote add origin https://github.com/denny0223/workshop.git
-
git remote
-
git remote -v
-
git remote show origin
--
--
-
git push -u origin master
-
git push origin master
-
git push
--
-
git branch
-
git branch -a
-
git branch -v
-
git branch -vv
--
git config --global credential.helper cache
git config --global credential.helper "cache --timeout=3600"
--
--
--
--
--
--
--
--
--
--
--
--
--
-
git branch <branch name>
-
git checkout -b <branch name>
--
--
git push <remote> <local_branch_name>:<remote_branch_name>
--
--
--
--
-
git merge
-
git merge --no-ff
--
--
--
--
Halloween Bash Profile Generator
function parse\_git\_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^\*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="\h:\W \u\$(parse_git_branch)$ "
--
--
--
--