Problem a: execute the Git remote add origin https://github.com/XXXXXXX/gif.git
Fatal: Remote Origin Already exists.
When this problem occurs, Git Remote displays all the remote libraries and USES the command Git Remote RM Origin to delete the origin.
Issue 2: git push-u origin master pushes the local repository to github
fatal: I don’t handle protocol ‘[email protected]’
This problem, use the command git remote add origin http://github.com/XXXXXXX/gif.git.
question 3: perform $git push -u origin master
the Username for ‘https://github.com/XXXXXXX/gif.git’
! [rejected] master – & gt; Master (the fetch first)
error: failed to push some refs to ‘https://github.com/XXXXXXX/gif.git’
hint: Updates were rejected because the remote contains work that you do
hint: Not have mature. 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-forward ‘in ‘git push –help’ for details.
The main reason for the error is that there is already a README file on git repository, so there may be conflicts during submission. In this case, you need to choose to keep the online file or discard the online file. If you discard the online document, you need to choose to force push when pushing, which requires the following command
git push origin master -f
If you choose to keep the readME file online, you need to execute it first
git pull origin master
Git usage steps:
Build a new ABC warehouse on GitHub.
Create a Git repository locally:
1, the mkdir ABC
2, CD ABC
3, git init
4. Add file (file)
5, Git add file1 file2 file…
6. Git-commit-m “Add Files”
7, git remote add origin https://git.oschina.net/xxx/abc.git
8. Git push-U Origin Master
Here, an error message appears:
error: failed to push some refs to ‘https://git.oschina.net/xxx/abc.git’
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. ‘git pull’)
hint: before pushing again.
hint: See the ‘Note about fast-forwards’ in ‘git push –help’ for details.
The push failed because a READme.md file was initialized on GitHub. The files in the remote repository are newer than the local ones, so to use Git Pull you need to grab the latest file, merge it with the local file and commit it.
9, the git pull
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 3 (delta 0)
Unpacking objects: 100% (3/3), done.
fc38031.. 291 bea8 dev – & gt; origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details
git pull < remote> < branch>
The reason is that there is no connection between the local master and the remote Origin /master.
10. Set up the connection
$ git branch –set-upstream master origin/master
11, the git pull
12. Then submit
git commit -m “merge README.MD”
13. Git push-U Origin Master completed local uploading to remote warehouse
- Error: failed to push some refs to ‘xxx’
- [Git & GitHub] Solution: error: failed to push some refs to’https://github.com/xxxx.git’
- How to Fix GIT Push Error
- Solve github :error: failed to push some refs to problem
- Please specify which branch you want to merge with
- git push error failed to push some refs to solution
- error: src refspec master does not match any error:failed to push some refs to ‘[email protected]:xxxx
- Error: You have not concluded your merge (MERGE_HEAD exists)
- pathspec ‘master’ did not match any files known to git
- error: src refspec master does not match anyerror: failed to push some refs to
- Git error: requested URL returned error: 403
- GitHub upload failed: git push error: failed to push some refs to exception handling
- Git uploads local IntelliJ idea project to GitHub
- Git solves pull origin error: the following untracked working tree files would be rewritten by merge
- [Git] git pull pull remote git push to remote git commit submit reject
- GitHub push ErrorThe requested URL returned error: 403 Forbidden while accessing
- Pull is not possible because you have unmerged files. Please, fix them up in the work tree, and then
- Git did not exit cleanly (exit code 128)
- Git push you are not allowed to upload merges