Day 12 - Cheat-Sheet

๐ Welcome to the world of DevOps with Aakash! ๐
Hey tech enthusiasts! ๐ I'm Aakash, a dedicated freelance Linux System Admin @xFusionCorp, and I'm on a mission to conquer the world of DevOps. Currently, I'm immersed in building exciting projects and sharing my learning experiences with you all.
๐ ๏ธ My Tech Arsenal:
- Docker
- Linux
- Kubernetes
- Jenkins
- AWS
- Python
- Java
- Prometheus
- Grafana
- Ansible
- Terraform
Join me in navigating the intricate realms of AWS DevOps technology. Let's embrace learning with gratitude and thrive in this ever-evolving landscape!
๐ค Connect with me for:
- Friendly chats
- Shared experiences
- Learning moments
Follow my journey on Twitter and Linkedin for daily insights and tech goodness. Let's build, automate, and innovate our way through the exciting world of DevOps! ๐ #DevOps #AWS #TechEnthusiast #InnovationJourney #90DaysOfDevOps
Introduction
Welcome DevOps enthusiasts. In DevOps, expertise in Linux and Git is paramount. Keeping that in mind this blog will be focusing on creating a concise bundle of commands, what most people call a "Cheat-Sheet".
What's new? The catch here is, every reader has to create their own cheat-sheet from their understanding of Git and GitHub. They can visit the previous blogs for reference and create their own version of their cheat-sheet.
What is the need? Creating our own Cheat sheet will not only help us revise the concepts, but also it'll make our understanding even more crisp and clear.
Along with that a google form will be given below where you can submit your cheat-sheet link, pdf or doc as you wish. And don't forget to share it on LinkedIn or Twitter for others to learn from it too. So without any further ado, let's begin.
Cheat Sheet
Initialization Commands
Initialize a git repository
git initClone a GitHub repo to your local machine
git clone <url>Connect to remote repository
git remote add origin <branch>Create a branch
git checkout <branch_name>Create and move to a new branch
git checkout -p <branch_name>List all the branches
git branchAdd changes made to a file, also known as staging.
git add <file_in_which_changes_were_made>Add all changed files in the current directory
git add .Commit the changes
git commit -m "commit message"Checking the status.
git statusPushing changes to the remote repository.
git push origin <branch_name>Remove a local git repository
rm -rf .gitTo configure username to local machine
git config user.name "Github_UserName"To configure email to local machine
git config user.email "GitHub_email"To update local branch with the changes made in the remote repo
git pull -rTo get changes from remote repo, but not merge it automatically
git fetchTo merge branches
git merge <branch_name_to_be_merged>Check logs like commits etc.
git logTo see difference between two commits
git diff <commit1> <commit2>To save your current changes into stash before committing it, in case need to work on other changes and not want to loose the previous changes.
git stashPop out from stash to dev line
git popList all the stash
git stash listTo see the contents of a stash
git stash show stash@{n}Reset a commit
git reset HEAD~n #no of commits from HEADSoft reset
git reset --soft HEAD~nHard reset
git reset --hard HEAD~nRevert the changes made in a commit
git revert <commit_hash>To revert the previous commit
git revert HEADTo see commit history / logs in a concise format
git log --onlineTo see logs in a graphical format
git log --graphRebase a feature branch onto the latest commit of the main branch
git checkout feature_branch git rebase main_branchHistory of changes made to a specific file
git log <file>Show the commits on branchA that are not on branchB
git log branchA..branchBDelete file from a project
git rm <file>Move file from one folder to another
git mv [existing-path] [new-path]To cherry-pick a commit
git cherry-pick <commit_hash>To Rename a branch
git checkout -R <old_branch_name> <New_Branch_name>
Conclusion
Here comes the end of My version of cheat sheet and now its your turn. I've summed up 37 commands starting covering all the corners of Git and GitHub, be it the very basics or be it the advanced one. Go through it and curate your own. I hope this will add value to your learnings.
Submit your cheat-sheet here: https://forms.gle/om6wLNB3woy7SKwz7
Ending this with a QUOTE
Embrace the challenges, master the tools, and transform your obstacles into opportunities. With Linux and Git as your allies, there's no limit to what you can achieve in the world of DevOps.
Happy Learning





