At times one may face an error when they try to push a branch to the origin.
git push origin master
Error:
Reason:
One of the most common problems that cause this error is that your project is not a git project, thus you cannot push it to the origin straight ways.
Fix:
You need to follow all the steps to make the current project a git-managed project first.
- Initialize the project as a git project.
git init - Add all files to the staging area.
git add . - Commit your code to the local repo.
git commit -m 'initial commit.' - Now you are good to move the project to git origin.
git push -u origin master

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!