1. 程式人生 > >GitHub實戰系列~2.把本地專案提交到github中 2015-12-10

GitHub實戰系列~2.把本地專案提交到github中 2015-12-10

——————————————————————————————————————————————————————

很多人問,明明有git gui 和 github可以直接圖形化操作的嗎?全部指令幹啥???

呃(⊙o⊙)…呃(⊙o⊙)… ===> 裝逼~

O(∩_∩)O~,開玩笑的,其實就是為了通用和熟悉git,linux裡面照樣這樣用,多熟悉點基礎指令很有用的,

如果覺得頓時不開心了、無愛了==>推薦你快速入門:http://www.imooc.com/learn/390

———————————————————————————————————————————————————————

例項1:

1.上面步驟和昨天一樣,先在github裡面新建一個專案,然後clone一份到本地(我這邊就不重新截圖了,引用一下昨天的步驟

10.在github裡面建立一個公開倉庫(私有的收費)並初始化倉庫(最下面的複選框,最下面的兩個下拉列表後面說)


————————————————————————————————————————
11.複製一份github ssh庫的地址,一會兒有用


————————————————————————————————————————
12.克隆一份到本地

git clone [email protected]:dunitian/test.git(剛才的地址)

————————————————————————————————————————
Cloning into 'test'...
Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hosts.
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.
Checking connectivity... done.
————————————————————————————————————————

=======================開始~==========================================

2.把本地檔案拖到git專案資料夾裡面(後面講怎麼過濾檔案)

3.開啟git bash 進入專案資料夾,新增全部(*) 提交

[email protected] MINGW64 ~
$ cd Windows10/

[email protected] MINGW64 ~/Windows10 (master)
$ ls

[email protected] MINGW64 ~/Windows10 (master)
$ ls
00.HelloWorld/   02.XAMLBaseDKill/  04.MyProgram/    AppTest/   Win10開發.sln  Win10開發.v12.suo
01.MyCommonAPP/  03.MyDivApp/       05.AllControls/  packages/  Win10開發.suo

[email protected] MINGW64 ~/Windows10 (master)
$ git add *

[email protected] MINGW64 ~/Windows10 (master)
$ git commit -m "逆天WP-Win10開發筆記原始碼(學習ing)"

4.push到github裡面

[email protected] MINGW64 ~/Windows10 (master)
$ git push

———————————————————————記錄1———————————————————————————————————

[email protected] MINGW64 ~
$ git clone [email protected]:dunitian/Windows10.git
Cloning into 'Windows10'...
Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.
warning: You appear to have cloned an empty repository.
Checking connectivity... done.

[email protected] MINGW64 ~
$ cd Windows10/

[email protected] MINGW64 ~/Windows10 (master)
$ ls

[email protected] MINGW64 ~/Windows10 (master)
$ ls
00.HelloWorld/   02.XAMLBaseDKill/  04.MyProgram/    AppTest/   Win10開發.sln  Win10開發.v12.suo
01.MyCommonAPP/  03.MyDivApp/       05.AllControls/  packages/  Win10開發.suo

[email protected] MINGW64 ~/Windows10 (master)
$ git add *

[email protected] MINGW64 ~/Windows10 (master)
$ git commit -m "逆天WP-Win10開發筆記原始碼(學習ing)"
[master (root-commit) 1bb5aa4] 逆天WP-Win10開發筆記原始碼(學習ing)
 990 files changed, 64617 insertions(+)
 create mode 100644 00.HelloWorld/00.HelloWorld.csproj
 create mode 100644 00.HelloWorld/00.HelloWorld.csproj.user
 create mode 100644 00.HelloWorld/App.xaml
 
 create mode 100644 packages/repositories.config

[email protected] MINGW64 ~/Windows10 (master)
$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Counting objects: 729, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (681/681), done.
Writing objects: 100% (729/729), 5.58 MiB | 31.00 KiB/s, done.
Total 729 (delta 470), reused 0 (delta 0)
To [email protected]:dunitian/Windows10.git
 * [new branch]      master -> master

———————————————————————記錄2———————————————————————————————————
[email protected]_PC-PC MINGW32 /d/gitworks/test (master)
$ git commit -m "直接新增本地檔案庫到github"
[master f33514f] 直接新增本地檔案庫到github
2 files changed, 223 insertions(+)
create mode 100644 "\345\221\275\344\273\244.txt"
create mode 100644 "\350\256\260\345\275\225.txt"

[email protected]_PC-PC MINGW32 /d/gitworks/test (master)
$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Counting objects: 4, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 3.91 KiB | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
To [email protected]:dunitian/test.git
4e69105..f33514f master -> master
————————————————————————————————————————

相關推薦

GitHub實戰系列~2.本地專案提交github 2015-12-10

—————————————————————————————————————————————————————— 很多人問,明明有git gui 和 github可以直接圖形化操作的嗎?全部指令幹啥??? 呃(⊙o⊙)…呃(⊙o⊙)… ===> 裝逼~ O(∩_∩)O~,開玩笑的,其實就是為了通用

GitHub實戰系列~1.環境部署+建立第一個檔案 2015-12-9

—————————————————————————————————————————————————————— 很多人問,明明有git gui 和 github可以直接圖形化操作的嗎?全部指令幹啥??? 呃(⊙o⊙)…呃(⊙o⊙)… ===> 裝逼~ O(∩_∩)O~,開玩笑的,其實就是為了

本地專案提交GitHub遠端倉庫

本文主要說明Windows(Windows 10)環境下本地專案如何 新增遠端庫 並進行提交。本地環境的git賬號繫結以及 GitHub 上的倉庫(Repository)建立不做詳細描述。處理過程中也遇到過一些異常問題,如果有類似的異常現象,可以參考本文 異常參考 部分。 環境說明

GitHub實戰系列~4.github裡面的庫克隆到指定目錄+日常使用 2015-12-11

—————————————————————————————————————————————————————— 很多人問,明明有git gui 和 github可以直接圖形化操作的嗎?全部指令幹啥??? 呃(⊙o⊙)…呃(⊙o⊙)… ===> 裝逼~ O(∩_∩)O~,開玩笑的,其實就是為了通用

Spark入門實戰系列--2.Spark編譯與部署()--Hadoop編譯安裝

二進制包 1.10 不能 mapr 修復 att 機器 mave end 【註】該系列文章以及使用到安裝包/測試數據 能夠在《[傾情大奉送–Spark入門實戰系列] (http://blog.csdn.net/yirenboy/article/deta

Github安裝及上傳本地專案Github

github安裝 1、下載安裝包,進入https://gitforwindows.org,點選Download,如下: 2、下載後直接開啟檔案,點選下一步安裝完成 建立版本庫 1、註冊github賬號,進入https://github.com/,點選sign up進行

如何本地專案上傳至GitHub

1.首先下載git 桌面右擊顯示Git Bash Here、Git GUI Here表示安裝成功 2.在github網頁上建立一個git倉庫   echo "# boot" >> README.md(建立一個名為README.md,內容為# boo

本地專案提交Github遠端倉庫專案分支的全過程——賊詳細

個人學習,指正可以,不喜勿噴!!! 專案檔案(不是真實專案,僅演示): $ ll test_project/ total 1 -rw-r--r-- 1 Y 197121 24 九月 29 20:39 READEM 1.本地初始化 git init 進入本地專案,初始

Spring Boot 2+gRPC 學習系列1:搭建Spring Boot 2+gRPC本地專案

本專案基於Spring Boot 2.0.5+yidongnan/grpc-spring-boot-starter 2.0.1.RELEASE,通過grpc-lib,grpc-server,grpc-client 3個模組來模擬grpc的服務呼叫。 主要參考自y

github】將本地專案提交github

首先需要有一個github賬號,之前註冊了一個,但是沒有怎麼玩過,只是在github上下載過別人的程式碼,趁著週末,自己也倒騰倒騰怎麼玩的,記錄一下。 註冊賬號可以參考:如何註冊一個自己的github賬號 之前看過一篇部落格學習了寫關於git的使用,真的是超級詳細的那種,遺憾的是

本地專案上傳至github倉庫

 本地專案要上傳到github倉庫, 在github 上新建一個倉庫 在本地專案資料夾裡,右鍵 Git Bash Here 執行以下命令 git init   生成 .git git add README.md  生成README.md git commit -

Github使用之將已有專案提交Github/從Github上pull到本地

新增已有專案到github        新建repository,可以在github網站上直接新建或者使用windows github工具。        進入github repository 專案        在github windows工具中使

github——本地專案上傳到Github

在學習github中。 尊重原創,文章來自轉載: https://www.cnblogs.com/shenchanghui/p/7184101.html 作為一個有追求的程式設計師,需要擼點自己的開源專案,雖然我現在只是在學著造輪子,但這並不影響我成為大神的心。 Github是基於git

如何本地專案上傳到Github

作為一個有追求的程式設計師,需要擼點自己的開源專案,雖然我現在只是在學著造輪子,但這並不影響我成為大神的心。 Github是基於git實現的程式碼託管,很多程式設計師在上面託管自己的開源專案,我使用Github也不短時間了,不過之前並沒有託管程式碼,只是下載各位大牛的程式碼用來學習。希望以後也有很多人下載

mac下如何本地專案上傳到Github

本文將介紹在mac(windows下同理)下如何將本地專案上傳到 Github。 一、準備 1、註冊 github 賬號 具體方法本文不做介紹啦。 2、安裝 Git 客戶端 正常安裝即可,這裡也不多做介紹啦。 3、準備好要上傳的專案, 比如我們這裡有一個小專案,我們

提交本地專案github提交更新

一:首先當然是去github註冊賬號了。 二:註冊完畢登入後,在自己的首頁上面點選右上角“+”號,然後選擇New repository,或者直接點選下面的綠色按鈕,建立一個新倉庫。如圖: 然後填入倉庫的名稱: 填寫完畢後,點選下面的綠色按鈕,建立倉庫。 下載完畢

Mac Android studio提交本地專案Github 以及配置 SSH KEY

在本地配置ssh key祕鑰 配置好之後上面的圖這裡需要它 3 開始本地配置ssh key,首先檢視本地電腦是否有配置過ssh,進入終端 敲入$ defaults write com.apple.finder AppleShowAllFiles -b

eclipse上傳本地專案GitHub詳解(全步驟)

  首先新建一個倉庫: 然後,在頁面中點選你的賬號名字: 進入主頁面,點選Repositories,進入你的倉庫      這就是你剛剛建立的倉庫,像SVN一樣,先建立倉庫,再往裡面放東西   開啟Ecli

如何將本地專案提交到git伺服器

1、初始化git git init 2、新增要提交的檔案 git add 檔名(注:當要把整個專案都提交則用 git add . ,每次檔案只要被修改,都要重新在add一次,不然commit只會提交add 暫存區裡的內容) 3、完成提交 git commit -m "描述" 4、將本地git和伺

【工具】github入門到上傳本地專案

GitHub是基於git實現的程式碼託管。git是目前最好用的版本控制系統了,非常受歡迎,比之svn更好。 GitHub可以免費使用,並且快速穩定。即使是付費帳戶,每個月不超過10美刀的費用也非常便宜。 利用GitHub,你可以將專案存檔,與其他人