【轉】Github輕鬆上手4-經常使用的git命令

轉自: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/
相關文章
相關標籤/搜索