'failed to push some refs to 'https://github.com/<username>/my-history.git'
I can't update the source code in the repository on github.com using the following command.
$ git push -u origin master
The following error is displayed:
! \[rejected\] master -\> master (fetch first)
error: failed to push some refs to 'https://github.com/\<username\>/my-history.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.
Is there any way to do this?
I want to push the source code in the my repository.
Solution 1:[1]
I experienced something similar to this a few days ago.
You can do something like this:
$ git remote add origin https://github.com/username/my-repo.git
$ git push -f origin master
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |