?? Post 1 - Git Essentials: First Steps in Version Control
Bruno Freitas
Senior React Developer | Full Stack Developer | JavaScript | TypeScript | Node.js
?? Getting started with Git – Whether you're a beginner or looking to solidify your Git knowledge, understanding version control is crucial for every developer.
What is Git? Why is it important?
Git is a distributed version control system that helps teams collaborate, track changes, and manage code efficiently. Instead of relying on outdated manual backups like filev2_final_final_really_final.js_, Git lets you:
? Keep a history of changes
? Work on different features simultaneously
? Roll back to previous versions if needed
?? Setting up Git
Before using Git, configure your user details:
sh
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
?? Creating a Git repository
To initialize a new Git repository:
mkdir my_project && cd my_project
git init
Now, the folder is under version control.
To clone an existing repository:
git clone https://github.com/user/repository.git
?? Making your first commit
1?? Create a file:
echo "Hello, Git!" > hello.txt
2?? Add the file to the staging area:
git add hello.txt
3?? Commit your changes:
git commit -m "Initial commit"
4?? Check the commit history:
git log --oneline
?? Pro Tip: Always write meaningful commit messages! Instead of "fixed stuff", use "Fix button alignment on the login page".
?? Next post: We’ll dive into branches and how to manage multiple features efficiently!
?? What was your first Git mistake? Let’s share and learn together!
.Net Software Engineer | C# | API Development | Sql Server
1 周Nice!
Senior Fullstack Developer | Java, Angular & React Specialist | Oracle & AWS Certified
2 周Great perspective, Bruno!
Senior .NET Software Engineer | Senior Full Stack Developer | C# | .Net Framework | Azure | React | SQL | Microservices
2 周?? Well articulated perspective!
Senior Full Stack Software Engineer | C# | .NET | SQL | Javascript | React | JQuery | TDD
2 周Nice, I use some very basic commands on a daily basis, and those can help me improve my workflow.
Android Developer | Mobile Software Engineer | Kotlin | Jetpack Compose | XML
2 周Nice content!! Thanks for sharing!!