Git is a distributed version control system that helps you track changes in your code, collaborate with others, and manage your project's history. This guide covers the basic Git commands and concepts.
Before using Git, make sure it's installed on your machine. You can download it from here.
After installation, configure your name and email:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
git init
git add <filename>
git add .
git commit -m "<commit message>"
git push origin <branch name>
Create a new branch for a feature or bug fix:
git branch <feature-branch>
Switch to the new branch:
git checkout feature-branch
Merge changes back into the main branch:
git checkout main
git merge feature-branch
Clone a remote repository to your local machine:
git clone https://github.com/username/repo.git
Update your local repository with remote changes:
git pull origin main
Push your local changes to the remote repository:
git push origin main
git status
: Check the status of your repository.git log
: View commit history.git diff
: Show changes between commits.
https://www.figma.com/file/jEqOupFgUT4MSdxuv8ZBFH/Restaurants?node-id=1%3A3&mode=dev