網站首頁 編程語言 正文
push的時候無法提交成功
error: src refspec master does not match any
error: failed to push some refs to 'https://gitee.com/xxxxxxx/cool-admin-midway.git'
問題的內容是:
錯誤:SRC ReFSPEC主控器不匹配任何。
錯誤:未能將某些引用推到’https://gitee.com/xxxxxxx/cool-admin-midway.git’
也就是倉庫為空。
解決辦法:
利用git add xxx.py
(git add .
添加所有) 指令,將所有的文件全部都添加,然后再進行git commit -m "init"將所有的文件commit,
git commit -m "init"
然后在執行
$ git remote add origin xxxxxxxx.git
最后使用
$ git push -u origin master
這樣就可以上傳成功,在倉庫可以看到代碼上傳成功
總結:
其實只需要進行下面幾步就能把本地項目上傳到Github
1、在本地創建一個版本庫(即文件夾),通過git init把它變成Git倉庫;
2、把項目復制到這個文件夾里面,再通過git add .把項目添加到倉庫;
3、再通過git commit -m "注釋內容"把項目提交到倉庫;
4、在Github上設置好SSH密鑰后,新建一個遠程倉庫,通過git remote add origin https://github.com/guyibang/TEST2.git將本地倉庫和遠程倉庫進行關聯;
5、最后通過git push -u origin master把本地倉庫的項目推送到遠程倉庫(也就是Github)上;(若新建遠程倉庫的時候自動創建了README文件會報錯,解決辦法看上面)。
完整的本地上傳文件到gitee的步驟
Git 全局設置:
git config --global user.name "namexxxx"
git config --global user.email "emailxxx"
創建 git 倉庫:
mkdir test_code
cd test_code
git init
git add xxxx (添加文件,git add . 添加所有)
git commit -m "first commit"
git remote add origin https://xxxxx.git
git push -u origin master
原文鏈接:https://blog.csdn.net/weixin_45939191/article/details/120894126
相關推薦
- 2023-07-16 uniapp 下拉菜單 picker
- 2022-05-08 一起來練習C++的指針_C 語言
- 2022-10-28 Go中的應用配置管理詳解_Golang
- 2022-09-16 10?個Python中Pip的使用技巧分享_python
- 2022-11-09 docker容器直接退出如何進入容器調試模式_docker
- 2022-08-10 pandas數據清洗實現刪除的項目實踐_python
- 2022-12-05 python?os.stat()如何獲取相關文件的系統狀態信息_python
- 2022-11-07 使用react-native-doc-viewer實現文檔預覽_React
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支