如何在没有用户名和密码的情况下推送到github Wiki? [英] How to push to github wiki without username and password?

查看:51
本文介绍了如何在没有用户名和密码的情况下推送到github Wiki?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功配置为使用ssh-key从我的github存储库中提取/推送用户名和密码.

但是我找不到没有用户名和密码的用于该回购的拉动/推送Wiki的方法.

有人可以帮忙吗?

谢谢!

解决方案

Wiki只是Git存储库,您可以在本地进行更改并将其推送到存储库中.但是您必须单独克隆它.

在存储库名称后附加 .wiki.git .

也就是说,如果您的存储库名称为foobar:

  git clone git@github.com:myusername/foobar.git 

将是克隆存储库的路径,并且

  git clone git@github.com:myusername/foobar.wiki.git 

将是克隆其Wiki的路径.

您还可以在标题右下角的Wiki页面上搜索克隆链接:

在本地克隆此Wiki

在这里您会找到 https 克隆链接,只需将其更改为 ssh 克隆链接,它将被克隆到本地,您可以从本地更新存储库./p>

这应该是ssh链接的格式:

  git @< host>:<用户名>/< repo_name> .wiki.git 

克隆了Wiki后,您可以添加新文件,编辑现有文件并提交更改.您和您的协作者可以在创建Wiki时创建分支,但是只有推送到master分支的更改才会生效,并且可供读者使用.

I've succeeded to config to pull/push from my github repo without username and password using ssh-key.

But I cannot find a way to pull/push wiki for that repo without username and password.

Could someone please help?

Thanks!

解决方案

Wikis are just Git repositories, you can make changes locally and push them to your repository. But you have to clone it separately.

Append .wiki.git to the repository name.

That is, if your repository name was foobar:

git clone git@github.com:myusername/foobar.git

would be the path to clone your repository and

git clone git@github.com:myusername/foobar.wiki.git

would be the path to clone its wiki.

Also you can search the clone link on the wiki page on the bottom right side with heading:

Clone this wiki locally

Here you will find the https clone link just change it to ssh clone link it will get cloned to your local and you can update the repo from your local.

This should be the format for the ssh link:

git@<host>:<username>/<repo_name>.wiki.git

Once you have cloned the wiki, you can add new files, edit existing ones, and commit your changes. You and your collaborators can create branches when working on wikis, but only changes pushed to the master branch will be made live and available to your readers.

这篇关于如何在没有用户名和密码的情况下推送到github Wiki?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆