使用git命令提交代码到Github远程仓库的方法
首先新建一個(gè)github地址倉(cāng)庫(kù)名字隨便取:
文件然后記下github倉(cāng)庫(kù)的地址,在桌面新建剛剛創(chuàng)建創(chuàng)庫(kù)的名字為文件夾,添加一些項(xiàng)目文件后使用這個(gè)命令初始化倉(cāng)庫(kù):git init
如下圖:
2.使用這個(gè)命令添加所有文件到本地倉(cāng)庫(kù):git add .
3.使用git命令:git remote add origin https://github.com/xiayiye5/XiaYiYe5Tools,將本地倉(cāng)庫(kù)與遠(yuǎn)程倉(cāng)庫(kù)建立關(guān)聯(lián)
4.使用git命令:git commit -m "文件注釋", 將本地?cái)?shù)據(jù)提交到本地倉(cāng)庫(kù)中
5.使用git命令:git push -u origin master,將本地倉(cāng)庫(kù)數(shù)據(jù)提交到已關(guān)聯(lián)的遠(yuǎn)程倉(cāng)庫(kù)中,輸入你github的賬號(hào)密碼即可
6.第一次彈框輸入賬號(hào)密碼可能會(huì)失敗,不要管再次提交會(huì)彈出下面github的登錄頁(yè)面輸入賬號(hào)密碼即可提交成功
7.看到上面顯示提交成功了,我們上github上面看看吧:
就此完工!!
看下完整的git命令提交圖:
完整版命令提交圖2:
感謝博主:博主直達(dá)
Command line instructions You can also upload existing files from your computer using the instructions below.Git global setup git config --global user.name "Cong Zheng" git config --global user.email "cong.zheng@wyze.cn"Create a new repository git clone git@ocean.wyzecam.com:jiuan/3irobotics/wyzecomet.git cd wyzecomet touch README.md git add README.md git commit -m "add README"Push an existing folder cd existing_folder git init git remote add origin git@ocean.wyzecam.com:jiuan/3irobotics/wyzecomet.git git add . git commit -m "Initial commit"Push an existing Git repository cd existing_repo git remote rename origin old-origin git remote add origin git@ocean.wyzecam.com:jiuan/3irobotics/wyzecomet.git?
?
總結(jié)
以上是生活随笔為你收集整理的使用git命令提交代码到Github远程仓库的方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Android开发之打开QQ聊天页面的方
- 下一篇: Please make sure you