Skip to main content

Command Palette

Search for a command to run...

GitHub - 30 GitHub commands used by every DevOps Engineer

Published
โ€ข3 min read
GitHub - 30 GitHub commands used by every DevOps Engineer
P

๐‘ช๐’๐’๐’–๐’… ๐’‚๐’๐’… ๐‘ซ๐’†๐’—๐‘ถ๐’‘๐’” ๐‘ป๐’†๐’„๐’‰ ๐‘ช๐’๐’Ž๐’Ž๐’–๐’๐’Š๐’•๐’š || ๐‘ท๐’“๐’๐‘ซ๐’†๐’—๐‘ถ๐’‘๐’”๐‘ฎ๐’–๐’š ๐Ÿค– https://t.me/prodevopsguy ๐Ÿ‘‹ Hi there! We are ProDevOpsGuy, a passionate DevOps enthusiast Tech Community with a strong belief in the power of automation and collaboration to drive innovation. ๐Ÿš€ I thrive in bridging the gap between development and operations, creating seamless and efficient software delivery pipelines. My journey in the world of DevOps has allowed me to blend my technical skills with a knack for problem-solving, enabling me to contribute effectively to agile and dynamic environments. ๐Ÿ’ก With a keen interest in continuous integration, continuous delivery (CI/CD), containerization, and orchestration, I've had the privilege to explore cutting-edge technologies like Docker, Kubernetes, Jenkins, and Ansible. I find joy in designing scalable and resilient infrastructures that enable teams to deploy applications faster and with greater confidence. ๐ŸŒ Beyond the tech realm, I'm an advocate for DevOps culture, emphasizing collaboration, communication, and a relentless pursuit of improvement. I'm always eager to connect with fellow professionals, exchange insights, and explore opportunities to collaborate on exciting projects. ๐Ÿ“š When I'm not tinkering with the latest DevOps tools, you can find me indulging in books on technology trends, hiking to rejuvenate, and occasionally experimenting with new coding challenges. ๐ŸŒŸ Let's connect! Whether you're looking to discuss DevOps methodologies, explore partnership opportunities, or simply share experiences, feel free to reach out. I'm excited to be part of the DevOps journey, driving excellence together.

Introduction:

Git & GitHub has steadily risen from being just a preferred skill to a must-have skill for multiple job roles today. In this article, I will talk about the Top 30 Git Commands that you will be using frequently while you are working with Git.

๐ŸŒ Essential GitHub Commands Every DevOps Engineer Should Know

1. git init

๐Ÿ› ๏ธ Description: Initializes a new Git repository in the current directory.

2. git clone [url]

๐Ÿ› ๏ธ Description: Clones a repository into a new directory.

3. git add [file]

๐Ÿ› ๏ธ Description: Adds a file or changes in a file to the staging area.

4. git commit -m "[message]"

๐Ÿ› ๏ธ Description: Records changes to the repository with a descriptive message.

5. git push

๐Ÿ› ๏ธ Description: Uploads local repository content to a remote repository.

6. git pull

๐Ÿ› ๏ธ Description: Fetches changes from the remote repository and merges them into the local branch.

7. git status

๐Ÿ› ๏ธ Description: Displays the status of the working directory and staging area.

8. git branch

๐Ÿ› ๏ธ Description: Lists all local branches in the current repository.

9. git checkout [branch]

๐Ÿ› ๏ธ Description: Switches to the specified branch.

10. git merge [branch]

๐Ÿ› ๏ธ Description: Merges the specified branch's history into the current branch.

11. git remote -v

๐Ÿ› ๏ธ Description: Lists the remote repositories along with their URLs.

12. git log

๐Ÿ› ๏ธ Description: Displays commit logs.

13. git reset [file]

๐Ÿ› ๏ธ Description: Unstages the file, but preserves its contents.

14. git rm [file]

๐Ÿ› ๏ธ Description: Deletes the file from the working directory and stages the deletion.

15. git stash

๐Ÿ› ๏ธ Description: Temporarily shelves (or stashes) changes that haven't been committed.

16. git tag [tagname]

๐Ÿ› ๏ธ Description: Creates a lightweight tag pointing to the current commit.

17. git fetch [remote]

๐Ÿ› ๏ธ Description: Downloads objects and refs from another repository.

18. git merge --abort

๐Ÿ› ๏ธ Description: Aborts the current conflict resolution process, and tries to reconstruct the pre-merge state.

19. git rebase [branch]

๐Ÿ› ๏ธ Description: Reapplies commits on top of another base tip, often used to integrate changes from one branch onto another cleanly.

20. git config --global user.name "[name]" and git config --global user.email "[email]"

๐Ÿ› ๏ธ Description: Sets the name and email to be used with your commits.

21. git diff

๐Ÿ› ๏ธ Description: Shows changes between commits, commit and working tree, etc.

22. git remote add [name] [url]

๐Ÿ› ๏ธ Description: Adds a new remote repository.

23. git remote remove [name]

๐Ÿ› ๏ธ Description: Removes a remote repository.

24. git checkout -b [branch]

๐Ÿ› ๏ธ Description: Creates a new branch and switches to it.

25. git branch -d [branch]

๐Ÿ› ๏ธ Description: Deletes the specified branch.

26. git push --tags

๐Ÿ› ๏ธ Description: Pushes all tags to the remote repository.

27. git cherry-pick [commit]

๐Ÿ› ๏ธ Description: Picks a commit from another branch and applies it to the current branch.

28. git fetch --prune

๐Ÿ› ๏ธ Description: Prunes remote tracking branches no longer on the remote.

29. git clean -df

๐Ÿ› ๏ธ Description: Removes untracked files and directories from the working directory.

30. git submodule update --init --recursive

๐Ÿ› ๏ธ Description: Initializes and updates submodules recursively.


Thank you for reading my blog โ€ฆ:)

ยฉ Copyrights: ProDevOpsGuy

Join Our Telegram Community || Follow me for more DevOps Content

More from this blog

P

ProDevOpsGuy Tech Community

73 posts

Home of DevOps Best Blogs/Series