1. What is Git?
Git is a version control system that helps you track changes in your code and collaborate with others.
2. What is GitHub?
GitHub is a cloud platform for hosting Git repositories, enabling collaboration, code sharing, and project management.
3. Install Git
- macOS:
brew install git - Windows:
Download from git-scm.com.
4. Configure Git
git config –global user.name “Your Name”
git config –global user.email “your@email.com”
5. Create a Local Repository
git init my-project
cd my-project
6. Add and Commit Files
echo “# My Project” > README.md
git add README.md
git commit -m “Initial commit”
7. Create a GitHub Account
- Sign up at github.com.
8. Create a Remote Repository on GitHub - Click “New repository” on GitHub.
- Name your repo and click “Create repository”.
9. Connect Local Repo to GitHub
git remote add origin https://github.com/yourusername/your-repo.git
git push -u origin master
10. Common Git Commands
git status– Check repo statusgit add .– Stage all changesgit commit -m "message"– Commit changesgit pull– Get latest changes from GitHubgit push– Upload changes to GitHub
If you intrested to learn more concept please register free github begginers free course.