国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > 綜合 > 正文

Git建立本地倉庫并上傳到Gitee的詳細步驟

2024-07-21 02:03:50
字體:
來源:轉載
供稿:網(wǎng)友

電腦安裝git客戶端、注冊github賬號并登陸

到本地項目文件夾右鍵選擇git bash here

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

git config --global user.name "xxxx" git config --global user.email xxxxx@qq.com 

在本地項目目錄創(chuàng)建本地倉庫

 git init  

輸入命令后項目目錄會有一個隱藏的.git文件夾

上傳所有代碼到本地倉庫

git add.   (注意add后面有個點,與add之間有一空格)

這樣就把代碼上傳到本地倉庫了

 git commit -m "initial commit"

it

在gitee上新建項目,復制https://gitee.com/xxx/xx.git地址

關聯(lián)本地倉庫并上傳代碼

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

報錯:

執(zhí)行命令:

git pull origin master --allow-unrelated-histories

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

1.按鍵盤字母 i 進入insert模式

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

3.按鍵盤左上角"Esc"

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

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

提交到遠程報錯,如下:

src refspec master does not match any

原因:

本地倉庫為空

解決方法:

使用如下命令 添加文件;

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

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

$ 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 masterwarning: no common commitsremote: Counting objects: 3, done.remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0Unpacking objects: 100% (3/3), done.From github.com:hahah/ftpmanage * branch  master -> FETCH_HEAD * [new branch] master -> origin/masterFirst, rewinding head to replay your work on top of it...Applying: init files

繼續(xù)push,成功。

總結

到此這篇關于Git建立本地倉庫并上傳到Gitee的文章就介紹到這了,更多相關Git建立本地倉庫內容請搜索武林網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持武林網(wǎng)!

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 建昌县| 临潭县| 郁南县| 凉山| 河东区| 比如县| 廉江市| 乐平市| 星座| 东至县| 敖汉旗| 永兴县| 穆棱市| 武宁县| 四川省| 汕尾市| 石台县| 泾源县| 德保县| 湖口县| 芷江| 清涧县| 东海县| 赣榆县| 宁化县| 迭部县| 盱眙县| 四子王旗| 东港市| 武功县| 葫芦岛市| 信阳市| 威海市| 神农架林区| 资溪县| 阳信县| 贵德县| 孟州市| 宿州市| 左贡县| 修文县|