Merge pull request #24282 from lujun9972/add-MjAyMjAxMDQgMTAgR2l0IHR1dG9yaWFscyB0byBsZXZlbCB1cCB5b3VyIG9wZW4gc291cmNlIHNraWxscyBpbiAyMDIyLm1kCg==

自动选题[tech]: 20220104 10 Git tutorials to level up your open source skills in 2022
This commit is contained in:
Xingyu.Wang 2022-01-05 09:44:33 +08:00 committed by GitHub
commit ff39101fb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,94 @@
[#]: subject: "10 Git tutorials to level up your open source skills in 2022"
[#]: via: "https://opensource.com/article/22/1/git-tutorials"
[#]: author: "Manaswini Das https://opensource.com/users/manaswinidas"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
10 Git tutorials to level up your open source skills in 2022
======
These articles contain hacks, lesser-known facts, and tips and tricks
that can come in handy while working with Git.
![Business woman on laptop sitting in front of window][1]
Git is an indispensable part of the code-sharing development workflow. Be you a beginner or an expert, this powerful version control system is the first thing you are expected to learn when working with open source code. You don't need to know everything under the sun when it comes to Git, but knowing specific hacks makes sharing your code a lot easier on platforms like GitLab, so you can collaborate with developers far and near. If there's something you're not sure about, `git --help` can come to your rescue.
I'm amazed every day by the amount of control that knowing Git provides. There is not a single instance when you can't revert to an earlier version, however impossible or sticky the situation you may be in.
Opensource.com had a great set of articles regarding Git in 2021; I'm summarizing just the top 10. All the articles contain hacks, lesser-known facts, and tips and tricks that can come in handy while working with Git.
### A practical guide to using the git stash command
[Ramakrishna Pattnaik][2] explains the functions of the [git stash command][3]. This article highlights how `git stash` can help you list, check, save, and retrieve changes to ensure a hassle-free experience when switching branches. It can also help you track changes locally without committing and while maintaining a clean working directory.
### 5 commands to level up your Git game
[Seth Kenlon][4] details [five lesser-known Git commands][5] that can make your life easier. Developers can save time with commands like `git whatchanged, git stash, git worktree,` and `git cherry-pick`
### What is Git cherry-picking?
This tutorial by [Rajeev Bera][6] walks you through the what, why, and how of the [git cherry-pick command][7] and lists all possible use cases when `git cherry-pick` will help you escape a sticky situation.
### 3 reasons I use the git cherry-pick command
I share how [leveraging git cherry-pick][8] can help you avoid redundancy, handle multiple commits in one go, and restore lost changes.
### Experiment on your code freely with git worktree
The `git stash` command takes care of saving changes to a working directory. Seth Kenlon introduces us to `git worktree` and the several [git worktree use cases][9] that can help you get a repository back to a known state.
### 4 tips for context switching in Git
This article by [Olaf Alders][10] discusses the pros and cons of [four different ways of switching branches][11] while working with Git. These options will help you simplify your workflow and maintain a clean working directory without losing your changes.
### Find what changed in a Git commit
Seth Kenlon explains how to leverage simple commands like [git log and git whatchanged][12] to extract specific information regarding what changed in a Git commit. It's a helpful shortcut, and the name makes it easy to remember.
### 7 Git tips for managing your home directory
Seth Kenlon shares the dos and don'ts of [managing and organizing $HOME with Git][13] and explains how it made his life more convenient across devices. Even better, it's freed him to experiment with new ideas, knowing he can roll them back easily.
### GitOps vs. DevOps: What's the difference?
[Bryant Son][14] introduces you to [GitOps,][15] which he describes as an evolved version of DevOps that uses Git as the single source of truth. The article also lists helpful resources available on Opensource.com for learning DevOps and landing a job in open source.
### Get started with Argo CD
[Ayush Sharma][16] details the advantages of [Argo CD,][17] a pull-based GitOps development tool. Argo CD gives you the best of both worlds by managing Kubernetes manifests in Git and syncing them in a cluster.
Can you think of other Git hacks that make your life easier? Please let us know in the comments or [send us an article idea][18].
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/1/git-tutorials
作者:[Manaswini Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/manaswinidas
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating)
[2]: https://opensource.com/users/rkpattnaik780
[3]: https://opensource.com/article/21/4/git-stash
[4]: https://opensource.com/users/seth
[5]: https://opensource.com/article/21/4/git-commands
[6]: https://opensource.com/users/acompiler
[7]: https://opensource.com/article/21/4/cherry-picking-git
[8]: https://opensource.com/article/21/3/git-cherry-pick
[9]: https://opensource.com/article/21/4/git-worktree
[10]: https://opensource.com/users/oalders
[11]: https://opensource.com/article/21/4/context-switching-git
[12]: https://opensource.com/article/21/4/git-whatchanged
[13]: https://opensource.com/article/21/4/git-home
[14]: https://opensource.com/users/brson
[15]: https://opensource.com/article/21/3/gitops
[16]: https://opensource.com/users/ayushsharma
[17]: https://opensource.com/article/21/8/argo-cd
[18]: https://opensource.com/how-submit-article