导航

萌即是正义!时不时分享一些ACG活动记录与有趣代码的小站!

侧边栏
最新评论
广树管理员
2026-04-16 19:18
@Asuna:几乎是的
广树管理员
2026-04-16 19:18
@ZeroCounter:让AI实现过一版,但是修改内容比预想的多太多了,根本没时间审查😅
广树管理员
2026-04-16 19:17
@Zrzzz:说不定有了呢
Asuna
2026-04-16 06:31
佬用的是 Opus 嘛,Claude 神力!😭
ZeroCounter
2026-04-15 12:40
好可爱!建议实装到评论区(什么
攻略中
告别回忆 双想 ~Not always true~
暂无评分
Steam告别回忆 双想 ~Not always true~
2026年3月10日 22时 ~ 攻略中
已累计游玩1个月7天
“我觅见了生命中的唯一,而后——”
亚路塔:狐狸狐途的面包冒险
暂无评分
Steam亚路塔:狐狸狐途的面包冒险
2026年2月12日 19时 ~ 攻略中
已累计游玩2个月4天
一场席卷全世界的面包革命现在开始! 主人公查雅阴错阳差之下,开始了在荒废的岛屿上经营面包店的生活。 出外冒险搜集食材、研发崭新面包配方、遇见性格各异的伙伴们,建造更丰富的设施,用面包香气使无人问津的广场再次热闹起来!
ToHeart
暂无评分
SteamToHeart
2025年6月26日 19时 ~ 攻略中
已累计游玩9个月25天
AQUAPLUS推出的“温暖人心的校园恋爱游戏”将以高清全3D形式焕新归来!
fault - StP - LIGHTKRAVTE
暂无评分
Steamfault - StP - LIGHTKRAVTE
2025年5月29日 20时 ~ 攻略中
已累计游玩10个月22天
全球累计销量超过50万份的“fault”系列最新作!故事的舞台是一个融合了奇幻与科幻的超前世界——卢森海德王国。本作讲述了生活在此地的一个平凡又平庸的究极普通市民——名为果子的少年的故事。
PSN奖杯卡

PSN奖杯卡

归档
赞助商广告

Git Bash常用命令

作者:广树时间:2017-04-19 11:59:37分类:Git

设置 SSH Key

$ ssh-keygen -t rsa -C "邮箱地址"
回车后出现
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/gs/.ssh/id_rsa):
Created directory '/c/Users/gs/.ssh'.
回车后出现
Enter passphrase (empty for no passphrase):
设置一个密码(输入时不会有任何字符出现)后回车
Enter same passphrase again:
再次输入一次密码(输入时不会有任何字符出现)

成功后会出现类似

Your identification has been saved in /c/Users/gs/.ssh/id_rsa.
Your public key has been saved in /c/Users/gs/.ssh/id_rsa.pub.
The key fingerprint is:
fingerprnt值 你的邮箱
The key's randomart image is:
略


查看id_rsa.pub

$ cat ~/.ssh/id_rsa.pub



私人密钥与GitHub进行认证通信

$ ssh -T [email protected]
回车后出现
The authenticity of host 'github.com (xxx.xxx.xxx.xxx)' can't be established.
RSA key fingerprint is SHA256:xxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)?
输入yes后回车
Warning: Permanently added 'github.com,xxx.xxx.xxx.xxx' (RSA) to the list of known hosts.
Enter passphrase for key '/c/Users/gs/.ssh/id_rsa':
输入之前设置的密码(输入时不会有任何字符出现)后回车
Hi userid! You've successfully authenticated, but GitHub does not provide shell access.
出现上面的字符表示成功



clone已有仓库

$ git clone 仓库地址

回车后弹出可能验证信息

Enter passphrase for key '/c/Users/gs/.ssh/id_rsa':
需要输入一次密码
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 3 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), done.

表明成功。



查看状态

$ git status


提交至仓库

$ git add 文件名


$ git commit -m "add hello world"

此时可能会弹出认证信息

*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.
这个时候就需要输入
$ git config --global user.email "邮箱"
$ git config --global user.name "用户名"

成功后再次输入

$ git commit -m "add hello world"


[master 232df5d] add hello world
 1 file changed, 10 insertions(+)
 create mode 100644 hello_world.html

显示上面的信息表示成功提交。

这个时候可以通过

$ git log
来查看日志



进行push更新仓库

$ git push
进行认证后Github就能看到更新了。


donate.png


telegram banner (1).png