Back to blog
Sep 02, 2024
3 min read

How to upload a project to GitHub

how to upload project to github (work in termux)

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

  1. In the upper-right corner of any page, select , then click New repository.

    Github Example repository
  2. In the “Repository name” box, type a name for your project. For example, type “my-first-project.”

  3. In the “Description” box, type a short description.. For example, type “This is my first project on GitHub.”

  4. 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

  1. In the upper-right corner of any page, click your profile photo, then click Settings.

    Github Example repository
  2. In the left sidebar, click Developer settings.

  3. In the left sidebar, under Personal access tokens, click Tokens (classic).

  4. Select Generate new token, then click Generate new token (classic).

  5. In the “Note” field, give your token a descriptive name.

  6. To give your token an expiration, select Expiration, then choose a default option or click Custom to enter a date.

  7. 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.”

  8. Click Generate token.

  9. Optionally, to copy the new token to your clipboard.

    Github Example repository
  10. 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.