如何在Ubuntu上访问github

一、安装fastgithub

1、下载fastgithub,链接如下:https://github.com/dotnetcore/FastGithub/releases/download/2.0.4/fastgithub_linux-x64.zip

(PS:我是在Windows下载好后,拖拽到Ubuntu系统内的)

2、解压:(这步要在对应的路径下,比如我把上面下载好的fastgithub压缩包拖拽到主用户下,那我直接到主用户路径下,打开终端窗口运行下列代码)

unzip fastgithub_linux-x64.zip

3、将解压好的包 移动到 /opt

sudo mv fastgithub_linux-x64 /opt

4、删除压缩包

rm fastgithub_linux-x64.zip

5、切换到 /opt 目录下的fastgithub包内

cd /opt/fastgithub_linux-x64

6、以system服务自动启动(即打开虚拟机后,自己就会把fastgithub打开,推荐!!)

启动服务

sudo ./fastgithub start

如果你想关闭开机自动启动的话,可以运行下列这句代码。否则就不用运行

sudo ./fastgithub stop

如果你不想开机自动启动,而是手动启动

cd /opt/fastgithub_linux-x64

./fastgithub

(PS:如果有小伙伴按照上述方法没有开机自动启动的话,可以用下面的方法,成功的话可以跳过。)

上面方式不能开机自动打开fastgithub的话,用下面的方法

第一步:

sudo vim /lib/systemd/system/fastgithub.service

第二步:将下面内容复制保存

[Unit]
Description=fastgithub
After=network.target
[Service]
Type=forking
User=fastgithub
Group=fastgithub
ExecStart=/opt/fastgithub_linux-x64/fastgithub start
ExecReload=/opt/fastgithub_linux-x64/fastgithub restart
ExecStop=/opt/fastgithub_linux-x64/fastgithub stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target

第三步:启用fastgithub服务

systemctl enable fastgithub.service

第四步:重启一下虚拟机(开机、关机这个不用教吧...)

第五步:打开github验证一下是否可以成功进入!

二、配置代理

1、系统级别全局代理(推荐)

Ubuntu->设置->网络->网络代理

自动:http://127.0.0.1:38457

2、浏览器级别局部代理

以 Firefox 浏览器为示例:

1>Firefox浏览器->设置->常规->网络设置->设置。

2>自动代理配置的 URL(PAC):http://127.0.0.1:38457

3>确定就完成了!

三、证书(显示有潜在的安全问题)

这里以 Firefix浏览器 为示例,其他的浏览器类似

cd /opt/fastgithub_linux-x64

cp -r cacert cacert2

Firefox浏览器->设置->隐私与安全->证书->查看证书->证书颁发机构,导入 /opt/fastgithub_linux-x64/cacert2 目录下的 fastgithub.crt,勾选“信任由此证书颁发机构来标识网站”,最后确定即可!!

  • 3
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
要在Ubuntu上连接GitHub,你需要按照以下步骤进行操作: 1. 首先,安装Git。在终端中运行以下命令来安装Git: ``` sudo apt-get install git ``` 2. 创建SSH密钥对。在终端中运行以下命令来生成SSH密钥对: ``` ssh-keygen -t rsa -b 4096 -C "your_email@example.com" ``` 3. 将公钥添加到GitHub账户。使用以下命令将公钥复制到剪贴板: ``` cat ~/.ssh/id_rsa.pub | xclip -selection clipboard ``` 然后,登录到GitHub账户,转到"Settings" -> "SSH and GPG keys" -> "New SSH key",将公钥粘贴到"Key"字段中,并为该密钥提供一个描述性的标题。 4. 配置Git。在终端中运行以下命令来配置Git的用户名和邮箱地址: ``` git config --global user.name "your_username" git config --global user.email "your_email@example.com" ``` 5. 其他操作。你可以使用以下命令进行其他常见的Git操作: - 初始化一个新的Git仓库: ``` git init ``` - 克隆一个现有的Git仓库: ``` git clone https://github.com/your_username/repository.git ``` - 将文件添加到Git缓存: ``` git add file_name ``` - 提交更改到Git仓库: ``` git commit -m "commit_message" ``` - 将本地仓库与远程仓库建立连接: ``` git remote add origin https://github.com/your_username/repository.git ``` 请注意,上述命令中的"your_username"和"your_email@example.com"应替换为你自己的GitHub用户名和邮箱地址。 #### 引用[.reference_title] - *1* *2* *3* [在Ubuntu使用Git访问Github](https://blog.csdn.net/qq_42276781/article/details/124504966)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Jack_wenbai

你的点赞就是最大的帮助了

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值