- 我是gitlab的新手。
- 我需要将代码推送到git中。
- 所以我创建了一个新项目,当我推送代码时,我遇到了错误。
错误:无法将某些引用推送到“ http://sports.com/inji/sports.git”
- 按照以下说明进行操作,并在Google上搜索错误,但仍然没有运气。
- 我什至试图强制 git push -f origin master ,但仍然无法使用:(
- 你能告诉我如何解决它吗?
- 下面我将提供逐步说明,例如我的操作方式
cd existing_folder
git init
git remote add origin http://edclgitp401.bcbsfl.com/I8CX/benchmark.git
git add .
git commit -m "Initial commit"
git push -u origin master
8cx@LBBW81B5483 MINGW64 /c/repo/sports
$ git clone http://sports.com/inji/sports.git
Cloning into 'sports'...
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://sports.com/inji/sports.git/'
inji@kk.com /c/repo/sports
$ git config --global user.name "inji"
inji@kk.com /c/repo/sports
$ git config --global user.email "inji@sports.com"
inji@kk.com /c/repo/sports
$ git clone http://sports.com/inji/sports.git
Cloning into 'sports'...
warning: You appear to have cloned an empty repository.
Checking connectivity... done.
inji@kk.com /c/repo/sports
$ ls
sports/
inji@kk.com /c/repo/sports
$ cd sports/
inji@kk.com /c/repo/sports/sports (master)
$ ls
src/
inji@kk.com /c/repo/sports/sports (master)
$ cd src
inji@kk.com /c/repo/sports/sports/src (master)
$ ls
actions/ App.js assets/ constants/ index.js registerServiceWorker.js setupTests.js
App.css App.test.js components/ containers/ reducers/ Root.js
inji@kk.com /c/repo/sports/sports/src (master)
$ git init
Initialized empty Git repository in C:/repo/sports/sports/src/.git/
inji@kk.com /c/repo/sports/sports/src (master)
$ ls
actions/ App.js assets/ constants/ index.js registerServiceWorker.js setupTests.js
App.css App.test.js components/ containers/ reducers/ Root.js
inji@kk.com /c/repo/sports/sports/src (master)
$ git remote add origin http://sports.com/inji/sports.git
inji@kk.com /c/repo/sports/sports/src (master)
$ git add .
inji@kk.com /c/repo/sports/sports/src (master)
$ git commit -m "Initial commit"
inji@kk.com /c/repo/sports/sports/src (master)
$ git push -u origin master
Counting objects: 86, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (74/74), done.
Writing objects: 100% (86/86), 59.33 KiB | 0 bytes/s, done.
Total 86 (delta 7), reused 0 (delta 0)
remote: GitLab: File name components/HostComponent.zip was blacklisted by the pattern \.(jar|war|ear|class\b|keep|dll|exe|msi|pbl|pbd|zip|rar|tar|gz|7z|doc\b|docx|docm|dot|dotx|dotm|xlt|xltx|xltm|ppt|pptx|pptm|pot|potx|potm|vsd|vdx|key\b)$.
To http://sports.com/inji/sports.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://sports.com/inji/sports.git'