DEV Community

Cover image for My Git Learning Journey: From git init to git rebase πŸš€
SAHIL
SAHIL

Posted on

My Git Learning Journey: From git init to git rebase πŸš€

Hey everyone! πŸ‘‹

I've recently wanted to revisit the world of Git, and I wanted to share my experience and what I've learnt so far β€” in hopes that it might help someone who’s just starting out like me! This is just overview of GIT , Git itself is a big topic😊


🧠 What is Git?

Git is a distributed version control system used to track changes in source code during software development. It allows multiple developers to collaborate on a project without stepping on each other's toes. It's used in almost every modern software field, including:

  • Web Development
  • App Development
  • DevOps & SRE
  • Cloud Engineering
  • Machine Learning Projects
  • Open Source Contributions

In simple terms, Git is like a time machine for your code!


βœ… What I’ve Learned So Far

Here are some of the Git concepts and commands I've explored till now:

πŸ”Ή git init

This command initializes a new Git repository in your current directory. It creates a hidden .git folder and starts tracking changes.

git init 
Enter fullscreen mode Exit fullscreen mode

πŸ”Ή git branch

Branches are like alternate timelines of your project. You can create, switch, and delete branches using:

git branch new-feature # Create a new branch git branch # List all branches 
Enter fullscreen mode Exit fullscreen mode

πŸ”Ή git checkout

Switch between branches or even specific commits. You can use it like this:

git checkout new-feature # Switch to 'new-feature' branch 
Enter fullscreen mode Exit fullscreen mode

πŸ”Ή git commit

This command saves your changes in the repo with a message describing what you did.

git add . # Stage changes git commit -m "Added login feature" 
Enter fullscreen mode Exit fullscreen mode

πŸ”Ή git merge

Merging is how you bring changes from one branch into another. For example, to merge feature into main:

git checkout main git merge feature 
Enter fullscreen mode Exit fullscreen mode

πŸ”Ή git rebase

Rebase is another way to integrate changes. It creates a linear history and is useful for clean commit logs.

git checkout feature git rebase main 
Enter fullscreen mode Exit fullscreen mode

πŸ”Ή git log

Shows a list of all commits in your repository’s history:

git log 
Enter fullscreen mode Exit fullscreen mode

You can also use git log --oneline for a cleaner look.


πŸ’‘ Why Am I Learning Git?

I'm learnt Git as part of my DevOps and Cloud journey. Being able to manage code, track changes, and collaborate effectively is essential in any modern development workflow. Tools like GitHub, GitLab, and Bitbucket are built on top of Git.


πŸ”œ What’s Next?

Next up on my learning path:

  • Understanding Git workflows like Git Flow and Trunk-based Development
  • Exploring GitHub and remote repositories
  • Resolving merge conflicts
  • Working with .gitignore and Git configuration

πŸ™Œ Let’s Connect

If you’re learning Git too or want to share tips, feel free to connect with me! πŸ’¬

Happy to grow together in this journey. πŸš€

πŸ› οΈ "Practice doesn’t make perfect. Practice makes progress."


Thanks for reading! 😊

#LearningInPublic #GitJourney #DevOpsBeginner

Top comments (0)