List branch names
git branch
View Branches
git show-branch
Create new branch
git branch liguoliang-com
GDEV SimpleWordPressTheme # git show-branch
! [liguoliang-com] changed version
* [master] changed version
—
+* [liguoliang-com] changed version
Switch Branch
GDEV SimpleWordPressTheme # git checkout liguoliang-com
GDEV SimpleWordPressTheme # git status
# On branch liguoliang-com
Push new branch to Remote Server. e.g. Github:
GDEV SimpleWordPressTheme # git push origin liguoliang-com
Good book for Git: http://shop.oreilly.com/product/0636920022862.do
The Birth of Git
Prior to Git, the Linux Kernel was developed using commercial BitKeeper VCS, however, in 2005, “The commercial company that developed BitKeeper broke down, and the tool’s free-of-charge status was revoked. This prompted the Linux development community (and in particular Linus Torvalds, the creator of Linux) to develop their own tool” — http://git-scm.com/book/en/Getting-Started-A-Short-History-of-Git
Host your code online in as many public and private repositories as you want. Free for 5 users.
Give your code a home on the web. Share what you’re working on with your colleagues, collaborators, or potential employers.
All 5 user accounts are FREE.
Checkout: https://bitbucket.org/
1. 创建Repository
git init
2. Commit文件
git add .
git commit –m “init Import”
3. 查看状态
git status
4.增加本地Repo到服务器
git remote add origin https://github.com/.....git
5Commit 到服务器
git push origin master
6. 从gitHub复制Repository
git clone git://…git
7. 从服务器更新:
git pull origin master
当一个Repo在GitHub上创建完毕后会有简要提示:
touch README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/DavidGuoliang/DoubanAnalytics.git git push -u origin master
git remote add origin https://github.com/DavidGuoliang/DoubanAnalytics.git git push -u origin master
GitHub有提供Windows下的UI图形界面.
Links: http://gitref.org/creating/
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.