Tuesday 15 February 2022

Push file to GitHub Repository

 

Go to github.com, and log in to your account.

Click on the New button to create a new repository, enter a repository name and click on Create Repository button.


Create a repository on the local machine

 mkdir createnewproject

 cd createnewproject

 echo "# create new file for my project" >> README.md

 git init

 git add README.md

 git commit -m "first commit"

 git branch -M main


Push the changes in the local repository to GitHub

 git remote add origin <Your HTTPS_URL>

 git push -u origin main

 git status

Go to github.com, and check the remote repository


No comments:

Post a Comment