Answer the question
In order to leave comments, you need to log in
Why does Git say I have an error on git push when I shouldn't have one at all?
1) Did a "git init" in the local folder
2) Created a remote repository on GitHub
3) Created a .gitignore file in the local folder (node_modules, src)
4) Added a .gitignore file to the local repository
5) Made a commit to the local repository
6) Linked remote repository with local "git remote add origin { link }"
7) Pushed changes from local repository to remote "git push origin master"
Got the following picture:
Answer the question
In order to leave comments, you need to log in
were there any commits on the remote repository before git push
?
if yes, then before the first local commit, you need to do git pull origin master
.
you can do this (but .gitignore will be deleted, and I'm not responsible for other files)
git pull --force origin master
git push -u origin master
git push --force -u origin master
, or like this: but all changes will be erased remotely.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question