git 基本使用

來源:互聯網
上載者:User

標籤:

1.建立新分支

git branch <分支名>

2.提交你的修改

git status          查看檔案狀態

git diff            查看修改的檔案詳細內容

git add .           添加當前修改的檔案到暫存區

git commit –m "你的注釋"    提交你的並加上注釋

git pull origin <分支名>   拉遠程代碼,個人習慣性加上分支

git push origin <分支名>   推送代碼到遠程分支

3.分支合并

git merge <branch> # 將branch分支合并到當前分支

git merge origin/master --no-ff # 不要Fast-Foward合并,這樣可以產生merge提交

4.打tag

git tag  查看所有tag

git tag -a <tag名稱> -m "tag注釋"

git push origin --tags  推送tag到遠程伺服器

git tag -d <tag名稱>   刪除本地tag

 

更多的請參考:http://blog.csdn.net/waterforest_pang/article/details/9762863

http://justcoding.iteye.com/blog/1830388


【聲明】 

歡迎轉載,但請保留文章原始出處

部落格地址:http://www.cnblogs.com/lping/

文章來源:http://www.cnblogs.com/lping/articles/5470670.html 

 

git 基本使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.