Skip to content

Latest commit

 

History

History
43 lines (39 loc) · 1.22 KB

Creating-a-GitHub-Repository.md

File metadata and controls

43 lines (39 loc) · 1.22 KB

Creating a GitHub Repository

  1. Go to GitHub and log in.
  2. Click the “+” icon in the top right corner and select “New repository”.
  3. Fill in the repository name, description (optional), and choose between public or private.
  4. Initialize the repository with a README if desired.
  5. Click “Create repository”.

Connecting Local Repository to GitHub

  1. Initialize Git in Your Project Directory:

    • Open your terminal and navigate to your project directory:
      cd /path/to/your/project
    • Initialize a new Git repository:
      git init
  2. Add Remote Repository:

    • Copy the URL of your GitHub repository (found on the repository page under the “Code” button).
    • Add the remote repository:
      git remote add origin https://github.com/yourusername/your-repository.git
  3. First Commit and Push:

    • Add your project files to the staging area:
      git add .
    • Commit your changes:
      git commit -m "Initial commit"
    • Change branch
      git branch -M main
    • Push your changes to GitHub:
      git push -u origin main