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)