转自:http://blog.sina.com.cn/s/blog_4b55f6860100zzih.htmlhtml
附上一些git的常见命令:git
• git remote add origin git@github.com:myaccount/myproject.git github
• git push -u origin master日志
• gitinit--------创建repositoryhtm
• git 命令 --help-----------查看帮助命令blog
• touch filenamerem
• git status------查看状态get
• git add filename--------加入文件到临时的东东it
• git commit -m "add the file filename" -----commit到repository中ast
• git log------查看日志
• echo "ddd" > filename ------修改filename(先清空)
• git add filename
• git commit -m "filename changed"
• git diff 版本一 版本二--------比较不一样
• git reset 版本号--------返回到版本号
• git revert 版本号--------撤销到版本号
• git checkout filename------撤销当下没有git add的动做
• git branch-------参看分支信息
• git branch develop-----创建分支
• git checkout develop-----切换分支
git merge develop------合并分支(将develop merge到master上,develop不变)
http://help.github.com/mac-set-up-git/