github上傳-遠程倉庫管理

來源:互聯網
上載者:User

標籤:工作   --   remote   status   兩條命令   com   init   repos   添加   

https://github.com/


1.在Windows上安裝Git
2.你的名字和Email地址

 

1.giithup刪除遠程庫
2.giithup遠程庫關聯本地
3.giithup建立與合并分支


3.本地版本庫

  • git init命令把這個目錄變成Git可以管理的倉庫
  • F:\MyRepository
  • 工作區,暫存區

4.op
op1添加+提交

  • git status
  • git add readme.txt
  • git commit -m "wrote a readme file"
  • git push -f origin master

查看:

http://htmlpreview.github.io/?
https://github.com/lanczh/works/blob/master/web/index.html

op2運行git status命令看看結果

  • git status
  • git rm


遠程倉庫
我們根據GitHub的提示,在本地的learngit倉庫下運行命令
1.方法一
https://github.com/lanczh/works.git
本地版本庫
媽媽再也不用擔心我的硬碟了


CodeReposition
F:\CodeReposition


ssh -T [email protected]
git clone https://github.com/lanczh/works.git

2.方法二
將本地的已有項目關聯到github上的新的項目上
F:\CodeReposition下執行
git remote add origin https://github.com/lanczh/works.git

我們建立dev分支,然後切換到dev分支
git checkout -b branch0822 //相當於以下兩條命令:git branch dev/ git checkout dev


然後,用git branch 命令查看當前分支:

  • git branch
  • git checkout master
  • git merge dev
  • git branch -d dev


git 衝突

  • git status也可以告訴我們衝突的檔案
  • Git用<<<<<<<,=======,>>>>>>>標記出不同分支的內容,我們修改如下後儲存:
  • 用git log --graph命令可以看到分支合并圖
  • git log --graph --pretty=oneline --abbrev-commit

https://github.com/lanczh/works/blob/master/pos/index.html



















github上傳-遠程倉庫管理

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.