Hi, you cannot commit nor push using GitHub CLI.
If you look at gh help, you will see commands related to GitHub Issues, Pull Requests, Releases, and so on. But there are no commands to make commits. This is because GItHub CLI does not replace git.
To commit and push, you can use git on the command-line:
$ git add myfile1.txt myfile2.txt
$ git commit -m "My commit message"
$ git push -u origin HEAD
How to ‘push’ with gh?
git - Uploading a project to GitHub using the command line - Stack Overflow
How to avoid the "Where should we push" prompt when running gh pr create?
Let the user bypass the pre-check command when pushing
Step-1:
Download git from here
Step-2:
Create a repository in github
Step-3:
goto your project folder
step-4
open git bash or cmd and initialize your project by typing git init
step-5
add files by typing git add . for adding all file
step-6
commit your project by typing git commit -m 'your message'
step-7
copy your remote location from github by typing
git remote add origin 'your repository link'
step-8
push your code in github by typing git push -u origin master
and thats all you need to do. Or check github documentation.
How do I upload a project on GitHub?
Create a repository in GitHub
Open Git Bash
Select the repository directory (
cd <path to folder>)Run the following commands.
git init git remote add origin <repository clone link> git add . git commit -m "commit" git push origin masterReload your GitHub repository page …
Now your project will upload successfully.