GitHub學習三-遠程版本庫更新與提交


1.遠程版本庫更新

一般來說,將本地與遠程相關聯之后,首先將數據從遠程更新下來再上傳比較好.

輸入

git pull origin master

 如果新建版本庫的話勾選了初始化包含readme.md,那么會將readme.md更新下來.

2.本地版本庫提交

改動的操作先提交到本地版本庫,再由本地版本庫提交到遠程版本庫

2.1  設置郵箱和用戶名

如果不設置,git commit的時候就會出現

$ git commit

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

輸入

$ git config --global user.name zwxbest

$ git config --global user.email zhangweixiao@live.com

 2.2 添加文件到暫存區.

git add AdvancedSpriteEditor.cs

 2.3 提交文件到本地版本庫

git commit -m "push new file about slice sprite "

 3.提交本地版本庫的更新到遠程版本庫

git push -u origin master

u是upstream的縮寫,

upstream表示的是本地版本庫,上流是發生變化的地方

遠程版本庫,自然就是downstream了.

 

有時候git push奇慢,沒辦法,沒被Q就已經謝主隆恩了.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM