使用git將本地代碼項目上傳到github ..

來源:互聯網
上載者:User

標籤:.dll   登入   str   eth   名稱   描述   intel   com   自身   

本地環境:

IntelliJ IDEA 2016.1.2 、git 用戶端 、github帳號 ...

Start building git project ...

1.登入到github.com後,點擊選中如所示:

2.添加建立資訊,分別如下:

Repository name: 倉庫名稱

Description(可選): 倉庫描述介紹

Public, Private : 倉庫許可權(公開共用,私人或指定合作者)

Initialize this repository with a README: 添加一個README.md

gitignore: 不需要進行版本管理的倉庫類型,對應組建檔案.gitignore

license: 認證類型,對應組建檔案LICENSE

根據自身配置,我的

3.點擊項目Clone or dowload會出現一個地址,複製https地址。

4.本地操作(可不必事先初始化)。進入到項目目錄點擊右鍵,選擇Git Bash Here,進入介面。

5.下載git代碼到本地( 使用git https項目地址 )。

6.本地操作。本地專案檔夾下面就會多出個工程檔案夾,將原本地檔案移動到新下載的工程目錄中。

(根據自身情況,在這裡。我只用把src、pom.xml 檔案移動到新目錄,其他不移動。)

7.更改新目錄下忽略檔案.gitignore。可根據自身項目進行配置。

# Compiled source ####################*.com*.class*.dll*.exe*.o*.so# Packages ############## it‘s better to unpack these files and commit the raw source# git has its own built in compression methods*.7z*.dmg*.gz*.iso#*.jar*.rar*.tar*.zip*.war# Logs and databases #######################*.log#*.sql*.sqlite# OS generated files #######################.DS_Store.DS_Store?._*.Spotlight-V100.Trashesehthumbs.dbThumbs.db# Eclipse project file #########################.project.settings.classpath.metadata# IDEA project file ######################.idea*.ids*.iml*.iws*.ipr# Maven generated files ##########################target# Others ###########./build./dist

8.輸入命令 cd maven-ssm-demo,進入到github下載的項目工程中。

9.依次輸入以下代碼即可完成其他剩餘操作:

git add . (註:別忘記後面的.,此操作是把maven-ssm-demo檔案夾下面的檔案都添加進來)

(該步驟謹慎操作,因本人之前把.idea .iml 檔案等都提交到了github中,導致版本控制會記錄更改,害的我又重新操作了一遍,步驟6做好的就可以直接操作了)

git commit -m "提交資訊" (註:“提交資訊”裡面換成你需要,如“first commit”)

git push -u origin master (註:此操作目的是把本地倉庫push到github上面,此步驟需要你輸入帳號和密碼)

10.First Blood .

(恭喜你拿下1血。基本就大功告成了。本地目錄在整理一下重新匯入就行了。覺得無所謂的也可以無視)

 

使用git將本地代碼項目上傳到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.