Skip to content

Instantly share code, notes, and snippets.

@sdwvit
Last active July 8, 2025 20:59
Show Gist options
  • Save sdwvit/af7344c2fb665baecaf3ed359dab5fc9 to your computer and use it in GitHub Desktop.
Save sdwvit/af7344c2fb665baecaf3ed359dab5fc9 to your computer and use it in GitHub Desktop.
Instruction.md

Step 1

Create a new repository for your project

It's a good idea to create a new repository for each individual project you're working on. If you're writing a software project, grouping all the related files in a new repository makes it easier to maintain and manage the codebase over time.

  • 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.
  • Select Add a README file. You will edit this file in a later step.
  • Click Create repository.

Step 2

βœ… Prerequisites

  • Git is installed: git --version
  • You have a GitHub account
  • You have created the repo in the first step
  • You have a local project folder (say it's called myproject)

πŸ”§ Steps to Push a Local Project to GitHub

  1. Open terminal and navigate to your project

    cd /path/to/myproject
  2. Initialize git (if not already)

    git init
  3. Add remote GitHub repo

    git remote add origin https://github.com/%your github username%/%your repo name from step 1%.git
  4. Add files to staging

    git add .
  5. Commit the files

    git commit -m "Initial commit"
  6. Push to GitHub (main branch)

    If you're pushing to the main branch:

    git branch -M main
    git push -u origin main

    If you're using master instead:

    git push -u origin master

βœ… Confirm

Visit your repo from step 1 β€” your project should now be visible there.


πŸ“ Optional

If you later want to update changes:

git add .
git commit -m "Some update message"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment