Just enough Git
Dear Friend,
27 years ago, a family friend visited our home and shared a simple yet powerful tip with me.
Start your day with two glasses of water to stay healthy and stronger.
At the time, I didn't appreciate the significance of this advice, but I began incorporating it into my daily routine by drinking water upon wake-up.
Many years later, I am happy to have made this a lifelong habit.
Okay, let's dive into the topic of week
Git is a tool for managing and tracking code changes.
Before we begin our discussion, I have two recommendations for learning anything:
Alright, the illustration below shows the sequence of flow and relevant actions of git commands.
Quick documentation to support the sequence diagram illustration.
git init: Initializes a new Git repository in the current directory.
$ git?init
git clone: Clones an existing Git repository to your local machine.
$?git?clone?https://github.com/user/repo.git
git add: Adds a file or directory to the staging area.
$ git?add?file.txt ( to add only mentioned file to staging area )
$ git?add?. ( to add all modified files to staging area )
git commit Commits changes to the local repository.
$?git commit -m?"Added new feature"
git push: Pushes committed changes to a remote repository.
$ git?push?origin master
git pull: Pulls changes from a remote repository to the local repository.
$?git pull origin master
What's Next?
Play and learn git here
If you enjoyed the article, subscribe to DevOps Stories newsletter for weekly updates.
Platform Engineering Manager | CKA | 2x AWS | 3x GCP
2 年Thanks Dev, happy to know you enjoyed playing with the tool.
awesome play and learn git : https://blinry.itch.io/oh-my-git ??