All Guides

Git and GitHub Setup

Install Git version control system and manage projects with GitHub.

Beginner15 min

Setup Steps

1. Install Git:

sudo apt install git -y

2. Git configuration:

git config --global user.name "Your Name"
git config --global user.email "email@example.com"

3. Create a new repository:

mkdir project && cd project
git init

4. Basic Git commands:

git add .
git commit -m "Initial commit"
git status
git log --oneline

5. Create a repository on GitHub (github.com/new)

6. Add remote and push:

git remote add origin https://github.com/username/project.git
git branch -M main
git push -u origin main

7. Connect via SSH key:

ssh-keygen -t ed25519 -C "email@example.com"
cat ~/.ssh/id_ed25519.pub

8. Add the copied key to GitHub > Settings > SSH Keys

9. Branch management:

git checkout -b new-feature
git merge new-feature
git branch -d new-feature

10. Create a .gitignore file:

node_modules/
.env
.DS_Store
dist/