branch name on bash prompt
#!/bin/bash parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ " |
[ new branch ]
$ git branch ## branch list
$ git branch "new branch name" ## branch create
$ git checkout "new branch name" ##branch change
$ git checkout -b "name" ##branch create and change
$ git add.
$ git commit -m "message"
$ git push origin "new branch name". ## git push [remote name] [branch name]
[ modification on branch ]
$ git push origin "branch name"
[ branch merge ]
$ git checkout master # firstly, move to master
$ git merge [branchname]
[ branch del ]
$ git branch -d [branchname]
WRITTEN BY
- RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.