濮阳杆衣贸易有限公司

主頁(yè) > 知識(shí)庫(kù) > Git建立本地倉(cāng)庫(kù)并上傳到Gitee的詳細(xì)步驟

Git建立本地倉(cāng)庫(kù)并上傳到Gitee的詳細(xì)步驟

熱門標(biāo)簽:地圖標(biāo)注項(xiàng)目幾個(gè)月 谷歌地圖標(biāo)注日期 400電話辦理費(fèi)用低 400電話申請(qǐng)到底哪家好 鶴壁高頻外呼系統(tǒng)多少錢一個(gè)月 宿遷怎么辦理400電話 外呼系統(tǒng)怎么群發(fā)短信 蘇州呼叫中心外呼系統(tǒng)哪家強(qiáng) 聯(lián)通外呼系統(tǒng)電腦app軟件

電腦安裝git客戶端、注冊(cè)github賬號(hào)并登陸

到本地項(xiàng)目文件夾右鍵選擇git bash here

輸入個(gè)人信息(代碼提交者)

git config --global user.name "xxxx" 

git config --global user.email xxxxx@qq.com 

在本地項(xiàng)目目錄創(chuàng)建本地倉(cāng)庫(kù)

 git init  

輸入命令后項(xiàng)目目錄會(huì)有一個(gè)隱藏的.git文件夾

上傳所有代碼到本地倉(cāng)庫(kù)

git add.   (注意add后面有個(gè)點(diǎn),與add之間有一空格)

這樣就把代碼上傳到本地倉(cāng)庫(kù)了

 git commit -m "initial commit"

it

在gitee上新建項(xiàng)目,復(fù)制https://gitee.com/xxx/xx.git地址

關(guān)聯(lián)本地倉(cāng)庫(kù)并上傳代碼

git remote add origin https://github.com/Yanyf765/hr_sys.git(上步驟復(fù)制的地址)

git push origin master

報(bào)錯(cuò):

執(zhí)行命令:

git pull origin master --allow-unrelated-histories

git 在pull或者合并分支的時(shí)候有時(shí)會(huì)遇到這個(gè)界面??梢圆还?直接下面3,4步),如果要輸入解釋的話就需要:

1.按鍵盤字母 i 進(jìn)入insert模式

2.修改最上面那行黃色合并信息,可以不修改

3.按鍵盤左上角"Esc"

4.輸入":wq",注意是冒號(hào)+wq,按回車鍵即可

之后就可以成功的pull,push了

提交到遠(yuǎn)程報(bào)錯(cuò),如下:

src refspec master does not match any

原因:

本地倉(cāng)庫(kù)為空

解決方法:

使用如下命令 添加文件;

$ git add add.php addok.php conn.php del.php edit.php editok.php ftpsql.sql index.php
 
$ git commit -m "init files"

之后在push過(guò)程中出現(xiàn)如下錯(cuò)誤:

$ git push -u origin master
Warning: Permanently added the RSA host key for IP address 'xx.xx.xxx.xxx' to the list of known hosts.
To git@github.com:hahaha/ftpmanage.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'git@github.com:hahahah/ftpmanage.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

提示使用 git pull 之后在 push

使用如下命令解決:

$ git pull --rebase origin master
warning: no common commits
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From github.com:hahah/ftpmanage
 * branch  master -> FETCH_HEAD
 * [new branch] master -> origin/master
First, rewinding head to replay your work on top of it...
Applying: init files

繼續(xù)push,成功。

總結(jié)

到此這篇關(guān)于Git建立本地倉(cāng)庫(kù)并上傳到Gitee的文章就介紹到這了,更多相關(guān)Git建立本地倉(cāng)庫(kù)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

您可能感興趣的文章:
  • 解決Unable to access ''https://gitee.com/自己的項(xiàng)目/'': Could not resolve host: gitee.com問(wèn)題
  • Gitee的下載安裝配置及使用步驟詳解
  • 微信小程序使用gitee進(jìn)行版本管理
  • Python自動(dòng)化運(yùn)維和部署項(xiàng)目工具Fabric使用實(shí)例
  • Python自動(dòng)化部署工具Fabric的簡(jiǎn)單上手指南
  • Python的自動(dòng)化部署模塊Fabric的安裝及使用指南
  • 使用Gitee自動(dòng)化部署python腳本的詳細(xì)過(guò)程

標(biāo)簽:哈爾濱 莆田 襄陽(yáng) 鄂爾多斯 遵義 雙鴨山 錫林郭勒盟 丹東

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Git建立本地倉(cāng)庫(kù)并上傳到Gitee的詳細(xì)步驟》,本文關(guān)鍵詞  Git,建立,本地,倉(cāng)庫(kù),并,上,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Git建立本地倉(cāng)庫(kù)并上傳到Gitee的詳細(xì)步驟》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于Git建立本地倉(cāng)庫(kù)并上傳到Gitee的詳細(xì)步驟的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    东阿县| 神农架林区| 泽库县| 海盐县| 黑山县| 常熟市| 宣化县| 阜城县| 嘉黎县| 南康市| 长岭县| 云梦县| 溆浦县| 米林县| 新建县| 乳山市| 西吉县| 临西县| 曲沃县| 隆安县| 阜康市| 荃湾区| 马鞍山市| 石城县| 浏阳市| 迭部县| 康马县| 泗阳县| 郧西县| 莆田市| 隆安县| 仁布县| 雷州市| 交口县| 蒙自县| 阜新市| 三门县| 千阳县| 潍坊市| 晋城| 长丰县|