I have a few projects that I have already started working on. I wanted to track all changes I was making, so I decided to initialize a repository and push all the changes onto Github.
I followed these steps:
- git remote add origin [email protected]:Anirudh-RK/Audiophile-App.git
- git branch -M main (or master)
- git push -u origin main
At the last step, I enter my credentials, and paste the auth token given by github. It throws all sorts of different errors however, such as only read access is allowed, write permission is denied, etc. What do I do here? I get repeatedly stuck at this step.
Any suggestions will be appreciated.
CodePudding user response:
Using the gh command line tool to manage authorization makes their job easier. After using the gh command as below, all the guidance you need can be done step-by-step from the command line. The gh command line tool can be used to create repositories that are not available on GitHub. It is necessary to use the gh repo create command once to create the repository as shown below. Then using the git push command will work if there is only one branch; additionally, if multiple branches are created on the remote repository, it is necessary to select the targeted branch.
# start version control in repository
git init -b main
# select tracked files and commit
git add . && git commit -m "initial commit"
# To push the repository to GitHub
gh repo create
Follow this link to use the gh command line tool on Windows OS.
