win10管理凌乱桌面_用于管理凌乱的开源存储库的命令行技巧
win10管理凌亂桌面
Effective collaboration, especially in open source software development, starts with effective organization. To make sure that nothing gets missed, the general rule, “one issue, one pull request” is a nice rule of thumb.
有效的協(xié)作(特別是在開(kāi)源軟件開(kāi)發(fā)中)始于有效的組織。 為確保不會(huì)遺漏任何東西,一般規(guī)則“一個(gè)問(wèn)題,一個(gè)請(qǐng)求請(qǐng)求”是一個(gè)很好的經(jīng)驗(yàn)法則。
Instead of opening an issue with a large scope like, “Fix all the broken links in the documentation,” open source projects will have more luck attracting contributors with several smaller and more manageable issues.
開(kāi)源項(xiàng)目不會(huì)像“修復(fù)文檔中所有斷開(kāi)的鏈接”這樣的大問(wèn)題,而是會(huì)吸引更多的貢獻(xiàn)者,幫助他們解決一些更小,更易于管理的問(wèn)題。
In the preceding example, you might scope broken links by section or by page. This allows more contributors to jump in and dedicate small windows of their time, rather than waiting for one person to take on a larger and more tedious contribution effort.
在前面的示例中,您可以按節(jié)或按頁(yè)劃分損壞的鏈接的范圍。 這樣一來(lái),更多的貢獻(xiàn)者就可以投入并奉獻(xiàn)自己的時(shí)間,而不是等待一個(gè)人承擔(dān)更大,更乏味的貢獻(xiàn)。
Smaller scoped issues also help project maintainers see where work has been completed and where it hasn’t. This reduces the chances that some part of the issue is missed, assumed to be completed, and later leads to bugs or security vulnerabilities.
范圍較小的問(wèn)題還可以幫助項(xiàng)目維護(hù)人員查看工作已完成和未完成的地方。 這樣可以減少錯(cuò)過(guò)問(wèn)題的某些部分(假定已完成)的機(jī)會(huì),并在以后導(dǎo)致錯(cuò)誤或安全漏洞。
That’s all well and good. But what if you’ve already opened several massively-scoped issues, some PRs have already been submitted or merged, and you currently have no idea where the work started or stopped?
一切都很好。 但是,如果您已經(jīng)打開(kāi)了幾個(gè)范圍廣泛的問(wèn)題,已經(jīng)提交或合并了一些PR,而您目前不知道工作在哪里開(kāi)始或停止,該怎么辦?
It’s going to take a little sorting out to get the state of your project back under control. Thankfully, there are a number of command line tools to help you scan, sort, and make sense of a messy repository. Here’s a small selection of ones I use.
需要進(jìn)行一些整理以使項(xiàng)目狀態(tài)重新得到控制。 值得慶幸的是,有許多命令行工具可幫助您掃描,排序和理解混亂的存儲(chǔ)庫(kù)。 這是我使用的一小部分。
用vim交互式搜索和替換 (Interactive search-and-replace with vim)
You can open a file in Vim, then interactively search and replace with:
您可以在Vim中打開(kāi)文件,然后以交互方式搜索并替換為:
:%s/\<word\>/newword/gcThe % indicates to look in all lines of the current file, s is for substitute, \<word\> matches the whole word, and the g for “global” is for every occurrence. The c at the end will let you view and confirm each change before it’s made. You can run it automatically, and much faster, without c, but you put yourself at risk of complicating things if you’ve made a pattern-matching error.
%表示在當(dāng)前文件的所有行中查找, s表示替代, \<word\>匹配整個(gè)單詞,而g表示“ global”,表示每次出現(xiàn)。 最后的c可以讓您查看并確認(rèn)每個(gè)更改,然后再進(jìn)行更改。 您可以在沒(méi)有c情況下自動(dòng)且以更快的速度運(yùn)行它,但是如果發(fā)生模式匹配錯(cuò)誤,您就有使事情復(fù)雜化的風(fēng)險(xiǎn)。
使用節(jié)點(diǎn)模塊在Markdown文件中查找無(wú)效鏈接 (Find dead links in Markdown files with a node module)
The markdown-link-check node module has a great CLI buddy.
markdown-link-check節(jié)點(diǎn)模塊具有出色的CLI伙伴 。
I use this so often I turned it into a Bash alias function. To do the same, add this to your .bashrc:
我經(jīng)常使用它,因此將它變成Bash別名函數(shù) 。 為此,請(qǐng)將其添加到您的.bashrc :
# Markdown link check in a folder, recursive function mlc () {find $1 -name \*.md -exec markdown-link-check -p {} \; }Then run with mlc <filename>.
然后使用mlc <filename>運(yùn)行。
列出具有或不具有g(shù)it存儲(chǔ)庫(kù)的子目錄以及find (List subdirectories with or without a git repository with find)
Print all subdirectories that are git repositories, or in other words, have a .git in them:
打印所有屬于git存儲(chǔ)庫(kù)的子目錄,或者換句話說(shuō),其中包含.git :
find . -maxdepth 1 -type d -exec test -e '{}/.git' ';' -printf "is git repo: %p\n"To print all subdirectories that are not git repositories, negate the test with !:
要打印不是git存儲(chǔ)庫(kù)的所有子目錄,請(qǐng)使用!取消測(cè)試! :
find . -maxdepth 1 -type d -exec test '!' -e '{}/.git' ';' -printf "not git repo: %p\n"使用xargs從列表中拉出多個(gè)git存儲(chǔ)庫(kù) (Pull multiple git repositories from a list with xargs)
I initially used this as part of automatically re-creating my laptop with Bash scripts, but it’s pretty handy when you’re working with cloud instances or Dockerfiles.
我最初將其用作使用Bash腳本自動(dòng)重新創(chuàng)建筆記本電腦的一部分,但是當(dāng)您使用云實(shí)例或Dockerfiles時(shí),它非常方便。
Given a file, repos.txt with a repository’s SSH link on each line (and your SSH keys set up), run:
給定文件repos.txt并在每行上包含存儲(chǔ)庫(kù)的SSH鏈接(并設(shè)置SSH密鑰),運(yùn)行:
xargs -n1 git clone < repos.txtIf you want to pull and push many repositories, I previously wrote about how to use a Bash one-liner to manage your repositories.
如果您想拉動(dòng)很多存儲(chǔ)庫(kù),我之前曾寫過(guò)關(guān)于如何使用Bash一線管理存儲(chǔ)庫(kù)的文章 。
用數(shù)字表的問(wèn)題jot (List issues by number with jot)
I’m a co-author and maintainer for the OWASP Web Security Testing Guide repository where I recently took one large issue (yup, it was “Fix all the broken links in the documentation” - how’d you guess?) and broke it up into several smaller, more manageable issues. A whole thirty-seven smaller, more manageable issues.
我是OWASP Web安全測(cè)試指南存儲(chǔ)庫(kù)的合著者和維護(hù)者,最近在該存儲(chǔ)庫(kù)中遇到了一個(gè)大問(wèn)題(是的,這是“修復(fù)文檔中所有斷開(kāi)的鏈接” –您怎么猜?)并破壞了它分成幾個(gè)較小的,更易于管理的問(wèn)題。 總共37個(gè)較小的,更易于管理的問(wèn)題。
I wanted to enumerate all the issues that the original one became, but the idea of typing out thirty-seven issue numbers (#275 through #312) seemed awfully tedious and time-consuming. So, in natural programmer fashion, I spent the same amount of time I would have used to type out all those numbers and crafted a way to automate it instead.
我想列舉一下原來(lái)的所有問(wèn)題,但是輸入37個(gè)問(wèn)題編號(hào)(#275至#312)的想法似乎很繁瑣且耗時(shí)。 因此,以自然的程序員方式,我花費(fèi)了與原本要鍵入所有這些數(shù)字相同的時(shí)間,并設(shè)計(jì)了一種自動(dòng)化的方法。
The jot utility (apt install athena-jot) is a tiny tool that’s a big help when you want to print out some numbers. Just tell it how many you want, and where to start and stop.
jot實(shí)用程序( apt install athena-jot )是一個(gè)很小的工具,當(dāng)您要打印一些數(shù)字時(shí), apt install athena-jot您有很大幫助。 只需告訴它您想要多少,以及在哪里開(kāi)始和停止。
# jot [ reps [ begin [ end ] ] ] jot 37 275 312This prints each number, inclusively, from 275 to 312 on a new line. To make these into issue number notations that GitHub and many other platforms automatically recognize and turn into links, you can pipe the output to awk.
這會(huì)在新行上打印每個(gè)數(shù)字(包括275至312)。 為了使這些成為GitHub和許多其他平臺(tái)自動(dòng)識(shí)別并轉(zhuǎn)化為鏈接的問(wèn)題編號(hào)符號(hào),您可以將輸出傳遞給awk 。
jot 37 275 312 | awk '{printf "#"$0", "}'#275, #276, #277, #278, #279, #280, #281, #282, #283, #284, #285, #286, #287, #288, #289, #290, #291, #292, #293, #295, #296, #297, #298, #299, #300, #301, #302, #303, #304, #305, #306, #307, #308, #309, #310, #311, #312You can also use jot to generate random or redundant data, mainly for development or testing purposes.
您還可以使用jot生成隨機(jī)或冗余數(shù)據(jù),主要用于開(kāi)發(fā)或測(cè)試目的。
CLI驅(qū)動(dòng)的開(kāi)源組織 (CLI-powered open source organization)
A well-organized open source repository is a well-maintained open source project. Save this post for handy reference, and use your newfound CLI superpowers for good! 🚀
組織良好的開(kāi)源資源庫(kù)是維護(hù)良好的開(kāi)源項(xiàng)目。 保存此帖子以方便參考,并永久使用您新發(fā)現(xiàn)的CLI超級(jí)功能! 🚀
翻譯自: https://www.freecodecamp.org/news/command-line-tricks-for-managing-your-messy-open-source-repository/
win10管理凌亂桌面
總結(jié)
以上是生活随笔為你收集整理的win10管理凌乱桌面_用于管理凌乱的开源存储库的命令行技巧的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 梦到自己摘槐花什么意思
- 下一篇: 梦到自己吃水饺是什么意思