Git基本操作

#git branch 显示当前分支是master
#git branch new-feature  创建分支
# git checkout new-feature 切换到新分支
# vi page_cache.inc.php
# git add page_cache.inc.php
Commit 到本地GIT
# git commit -a -m "added initial version of page cache"
合并到远程服务器
# git push origin new-feature

如果new-feature分支成熟了,觉得有必要合并进master
#git checkout master
#git merge new-feature
#git branch
#git push 
则master中也合并了new-feature 的代码

相关推荐