Here are short steps for uploading code to GitHub without any hassle and without taking a long time, By Arifzyn
Step 1
Go to github.com and create a new repository
-
In the upper-right corner of any page, select , then click New repository.
-
In the “Repository name” box, type a name for your project. For example, type “my-first-project.”
-
In the “Description” box, type a short description.. For example, type “This is my first project on GitHub.”
-
Select whether your repository will be Public or Private. Select “Public” if you want others to be able to see your project.
Step 2
Get your access tokens classic in Github
-
In the upper-right corner of any page, click your profile photo, then click Settings.
-
In the left sidebar, click Developer settings.
-
In the left sidebar, under Personal access tokens, click Tokens (classic).
-
Select Generate new token, then click Generate new token (classic).
-
In the “Note” field, give your token a descriptive name.
-
To give your token an expiration, select Expiration, then choose a default option or click Custom to enter a date.
-
Select the scopes you’d like to grant this token. To use your token to access repositories from the command line, select repo. A token with no assigned scopes can only access public information. For more information, see “Scopes for OAuth apps.”
-
Click Generate token.
-
Optionally, to copy the new token to your clipboard.
-
Save your token, because this will be needed later to upload to GitHub
Step 3
Open your terminal and type the command below, follow the steps
git init
git add .
Set Your Config Email and username, Make sure to enter your email and account username.
git config --global user.email "example@gmail.com"
git config --global user.name "example"
Commit your projects file, and follow this step
git commit -m "first commit"
git branch -M main
git remote add origin https://your-username/your-repository
git push -u origin main
If you have done the steps above, please enter your username and access tokens classic.
step 4
Please check github to see if your project has been uploaded.