How to publish from local to github


Let us assume you have created a project in your local machine

Step#1.

Create new empty repository on github https://github.com/new Please make sure you do not select Initialize this repository with a README checkbox. This is to ensure we dont get error while pushing local changes to github

Step#2.

Create local repository and create required codebase

Step#3.

Push to github

git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/XXX-your-username-XXX/XXX-your-repo-name-XXX.git
git push -u origin main

post by Pravin

#Ubuntu #Ubuntu

Comments


Tags