git学习笔记1

安装

设置SSH

$ ssh-keygen -t rsa -C "your_email@example.com"
Generating public/private rsa key pair.
Enter file in which to save the key
(/Users/your_user_directory/.ssh/id_rsa): **按回车键**
Enter passphrase (empty for no passphrase): **输入密码**
Enter same passphrase again: **再次输入密码**

将用户目录下**/.ssh/id_rsa.pub**的密钥复制到github的ssh管理里面

测试SSH

$ ssh -T git@github.com
The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is fingerprint值 .
Are you sure you want to continue connecting (yes/no)? 输入yes 

显示

Hi hirocastest! You've successfully authenticated, but GitHub does not 
provide shell access

说明成功,有的需要输入先前设置的密码

clone github仓库

先在github创建一个
再将ssh链接复制下来

 git clone 这里是你复制的ssh
 比如我的
  git clone git@github.com:(账户名)/仓库名.git
cd 仓库名

进入目录

设置本地编辑器命令

在桌面新建一个文件
文件名是你希望调用编辑器的命令名
比如我用sublime text,我的文件名sublime,不需要后缀
里面编辑上如下内容

#!/bin/sh
"H:\Sublime Text4\sublime_text.exe" $1 &

路径替换为你编辑器的路径
保存将它放在你git安装目录下

".\Git\mingw64\bin\"

然后调用命令如下

sublime hello.cpp

就会自动调用

同步内容到仓库

更新完文件后

 git add hello.cpp

添加你的更新文件

git commit -m "这是备注"

提交

git push

更新仓库
结束后仓库将更新

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

广阔天地,大有可为

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值