Git Started: A Practical Guide to Version Control for Beginners
Whether you’re just starting out or brushing up on your Git skills, this guide walks you through the foundational commands every developer…
Git Started: A Practical Guide to Version Control for Beginners
Photo by Farhat Altaf on Unsplash
Whether you’re just starting out or brushing up on your Git skills, this guide walks you through the foundational commands every developer should know.
1. 🚀 Creating a New Git Repository
mkdir new_repository # Create a directory for your project
cd new_repository # Navigate into the directory
git init # Initialize a new Git repository
2. 📦 Adding Files to Your Repository
git add . # Add all files to staging
git add hello.rb # Add a specific file
3. ✅ Committing Changes
git commit -m "Initial commit" # Save changes with a message
4. 🔍 Checking Repository Status
git status # View branch and file status
5. 🛠️ Configuring Git Identity
Local Setup (for current repo only):
git config user.name "Jone Doe"
git config user.email "email@gmail.com"
Global Setup (applies to all repos):
git config --global user.name "Jone Doe"
git config --global user.email "email@gmail.com"
6. 🌿 Branching in Git
View branches:
git branch
Create a new branch:
git branch branch_name
Create and switch to a new branch:
git checkout -b branch_name
Switch branches:
git checkout branch_name
Merge branch into master:
git checkout master
git merge branch_name
Delete a branch:
git branch -d branch_name # Safe delete
git branch -D branch_name # Force delete (use with caution)
7. 🌐 Cloning a Remote Repository
git clone https://github.com/username/repo_ame.git
You’ll be prompted for your GitHub username and password. As the username and password is provided it will clone the repository.
🎯 Final Thoughts
Git is more than just a tool — it’s a developer’s safety net. Once you master these basics, you’ll be ready to explore advanced workflows like rebasing, stashing, and resolving merge conflicts.
Happy coding!
메타데이터
- post_id
- c1528abee934
- slug
- git-started-a-practical-guide-to-version-control-for-beginners-c1528abee934
- url
- https://medium.com/@divyashrestha/git-started-a-practical-guide-to-version-control-for-beginners-c1528abee934
- canonical_url
- https://medium.com/@divyashrestha/git-started-a-practical-guide-to-version-control-for-beginners-c1528abee934
- author_url
- https://medium.com/@divyashrestha
- status
- ok
- fetched_at
- 2026-08-23 19:56:57