Projects in Git

Go up 🠥

Why remote repositories are necessary

Remote repositories (GitHub, GitLab, Bitbucket) are online copies of your project that provide backup, collaboration, and version history. They let you access your work from anywhere and share with teammates.

Steps for creating a project on GitHub

  1. Sign in to GitHub.
  2. Click New repository.
  3. Name it (e.g. my-first-project) and set visibility.
  4. (Optional) Initialize with README/.gitignore/license.
  5. Click Create repository.

Git commands you will often need

Create a project locally

mkdir my-first-project
cd my-first-project
git init

Link local repo to GitHub

git remote add origin https://github.com/username/my-first-project.git
git add .
git commit -m "Initial commit"
git push -u origin main

Useful everyday commands

git status
git log
git pull origin main
git push
git checkout -b feature/branch

How others can contribute

Contributors can fork/clone your repo, create branches, and open Pull Requests for review before merging into main.

  1. Clone:
    git clone https://github.com/username/project.git
  2. Create branch:
    git checkout -b feature/short-description
  3. Commit & push:
    git add .
    git commit -m "Describe changes"
    git push -u origin feature/short-description
  4. Open Pull Request on GitHub.