Github使用之將已有項目提交到Github/從Github上pull到本地__git

來源:互聯網
上載者:User

添加已有項目到github

       建立repository,可以在github網站上直接建立或者使用windows github工具。

       進入github repository 項目

       在github windows工具中使用git Bash開啟項目,使用cd命令進入已有項目根目錄下

touch README.md //建立說明檔案git init //在當前項目目錄中產生本地git管理,並建立一個隱藏.git目錄git add . //添加目前的目錄中的所有檔案到索引git commit -m "first commit" //提交到本地源碼庫,並附加提交注釋git remote add origin https://github.com/chape/test.git //添加到遠程項目,別名為origingit push -u origin master //把本地源碼庫push到github 別名為origin的遠程項目中,確認提交

       提交完成,查看repository。

更新代碼

cd /d/TVCloudgit add .git commit -m "update test" //檢測檔案改動並附加提交注釋git push -u origin master //提交修改到項目主線
github常用命令
git push origin master //把本地源碼庫push到Github上git pull origin master //從Github上pull到本地源碼庫git config --list //查看配置資訊git status //查看項目狀態資訊git branch //查看項目分支git checkout -b host//添加一個名為host的分支git checkout master //切換到主幹git merge host //合并分支host到主幹git branch -d host //刪除分支host

       轉自:http://blog.csdn.net/yishengzhiai005/article/details/51072878

聯繫我們

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