Answer the question
In order to leave comments, you need to log in
I get an error when I type git push -u Error: failed to push some refs to...?
At the moment I am learning to collaborate, contribute to other repositories.
Let's say there is a VvDone/Week3Test repository , I want to contribute to this project and add a file called "newFile.js" . I push Fork , now I have a copy of this Ralbf/Week3Test repository on my account .
I'm cloning the Ralbf/Week3Test repository to my computer.
I add a new branch named "AddNewFile" . git checkout -b AddNewFile Now
I add a new file newFile.js .
Indexing, committing: git add newFile.js. git commit -m "Add newFile.js"
Now I want to push the changes to the repository.
I enter the command:
git push --set-upstream origin AddNewFile.
But it doesn't work for me, because an error appears.
I read on the Internet that you need to enter git pull . Here is the output when I type git pull
I'm trying to type the commands that GIT suggests
1. git pull origin AddNewFile
2. git branch --set-upstream-to origin/AddNewFile AddNewFile.
help out)
Answer the question
In order to leave comments, you need to log in
You have been carried away to the wrong steppe. I think the initial problem is that you do not have permission to write to your repository - Remote rejected. At the first push, it usually asks to log in. That was done?
There was definitely no point in creating an empty branch with the same name on github, delete it, otherwise it will interfere with sending your real local branch.
I strongly recommend installing the github command line interface , it solves many problems.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question