创建最尖端it国家宣言要点_从命令行创建要点

创建最尖端it国家宣言要点

One of the best ways to gain contributors for your open source project is by providing a rough patch for the contributor to start from.  One of the best ways to ask for help is by providing what you have so far and letting a mentor look it over and provide suggestions.  In both cases, you'll need to put the code somewhere accessible by all parties and, since GitHub has taken over the code hosting world, what better platform to do it on?

为您的开源项目争取捐助者的最好方法之一是为捐助者提供一个粗略的补丁。 寻求帮助的最佳方法之一是提供您到目前为止所拥有的一切,然后让导师仔细研究并提供建议。 在这两种情况下,您都需要将代码放置在所有各方都可以访问的地方,并且由于GitHub接管了代码托管领域,因此,有什么更好的平台可以在上面进行操作?

Since pull requests make a lot of noise and the code you want to share isn't always merge material, the next best way is providing a GitHub gist.  Gists are easy to create manually but I wanted an automated method for creating gists, so I've turned to pretty-diff's gist-diff, a single command that creates a GitHub gist with git diff contents.

由于拉取请求会带来很多麻烦,并且您要共享的代码并不总是合并材料,因此,下一个最佳方法是提供GitHub要点。 Gist易于手动创建,但是我想要一种自动创建Gist的方法,因此我转向了pretty-diffgist-diff ,这是一个使用git diff内容创建GitHub gist的命令。

安装与配置 (Installation and Configuration)

Start by installing pretty-diff:

首先安装pretty-diff


npm install -g pretty-diff


The next step is ensuring your global git config knows your GitHub username:

下一步是确保您的全局git配置知道您的GitHub用户名:


git config --global github.user "MyGitHubUsername"


The last step is going to GitHub and creating a Personal Access Token (don't forget to check the "Create gist" checkbox) for the functionality pretty-diff provides.  Once you've created the token, execute the following:

最后一步是到GitHub,并创建一个个人访问令牌 (不要忘记选中“创建要点”复选框)以获取pretty-diff提供的功能。 创建令牌后,执行以下操作:


git config --global gist-diff.token "######################"


Now we're ready to use gist-diff!

现在我们准备使用gist-diff

创建要点 (Creating a Gist)

Once you've create the changes you'd like to share, run gist-diff to send your changes to GitHub:

创建要共享的更改后,运行gist-diff将更改发送到GitHub:


# just execute the command!
gist-diff


gist-diff creates a gist and then opens your browser to the URL of the gist.

gist-diff创建一个要点,然后打开浏览器到要点的URL。

I wish I had known about pretty-diff sooner, and from this point forward, it's going to be one of the first utilities I install on every new work computer.  Sharing code is one of the luxuries of the modern open source landscapes and the ability to create a gist of current changes with one command is a huge time saver.

我希望我早点了解pretty-diff ,并且从现在开始,它将成为我在每台新工作计算机上安装的第一个实用程序之一。 共享代码是现代开源环境中的奢侈品之一,使用一个命令创建当前更改要点的功能可节省大量时间。

翻译自: https://davidwalsh.name/create-gists

创建最尖端it国家宣言要点

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值