title: 树莓派Raspberrypi上配置Git

树莓派Raspberrypi上配置Git。

开始

首先你得有一树莓派!!!

过程

查看自己树莓派的版本

pi@raspberrypi:~ $ uname -a

运行效果:

Linux raspberrypi 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux

查看自己树莓派是否有安装Git

pi@raspberrypi:~ $ git --version

运行结果:

git version 2.11.0

设置自己的用户名称及电子邮箱

pi@raspberrypi:~ $ git config --global user.name "proschan"
pi@raspberrypi:~ $ git config --global user.email "710437653@qq.com"

运行效果:无,生成.gitconfig文件

查看.gitconfig文件

pi@raspberrypi:~ $ ls -al

运行效果:

total 104
drwxr-xr-x 18 pi pi 4096 Feb 1 12:56 .
drwxr-xr-x 3 root root 4096 Nov 29 01:22 ..
-rw------- 1 pi pi 802 Jan 25 16:08 .bash_history
-rw-r--r-- 1 pi pi 220 Nov 29 01:22 .bash_logout
-rw-r--r-- 1 pi pi 3523 Nov 29 01:22 .bashrc
drwxr-xr-x 6 pi pi 4096 Jan 20 09:03 .cache
drwx------ 11 pi pi 4096 Jan 20 15:12 .config
drwxr-xr-x 2 pi pi 4096 Nov 29 02:56 Desktop
drwxr-xr-x 5 pi pi 4096 Nov 29 02:22 Documents
drwxr-xr-x 2 pi pi 4096 Nov 29 02:56 Downloads
-rw-r--r-- 1 pi pi 50 Feb 1 12:56 .gitconfig
drwx------ 3 pi pi 4096 Nov 29 02:56 .gnupg
drwxr-xr-x 2 pi pi 4096 Jan 20 15:23 .idlerc
drwxr-xr-x 3 pi pi 4096 Nov 29 02:22 .local
drwxr-xr-x 2 pi pi 4096 Nov 29 02:56 Music
drwxr-xr-x 2 pi pi 4096 Nov 29 02:56 Pictures
drwx------ 3 pi pi 4096 Jan 20 09:03 .pki
-rw-r--r-- 1 pi pi 675 Nov 29 01:22 .profile
drwxr-xr-x 2 pi pi 4096 Nov 29 02:56 Public
drwxr-xr-x 2 pi pi 4096 Nov 29 02:22 python_games
drwxr-xr-x 2 pi pi 4096 Nov 29 02:56 Templates
drwxr-xr-x 3 pi pi 4096 Nov 29 02:56 .themes
drwxr-xr-x 2 pi pi 4096 Nov 29 02:56 Videos
-rw------- 1 pi pi 56 Jan 25 16:09 .Xauthority
-rw------- 1 pi pi 3954 Jan 25 16:09 .xsession-errors
-rw------- 1 pi pi 3954 Jan 25 14:58 .xsession-errors.old

创建SSH钥匙

pi@raspberrypi:~ $ ssh-keygen -t rsa -C "710437653@qq.com"

运行效果:

Generating public/private rsa key pair.
Enter file in which to save the key (/home/pi/.ssh/id_rsa):
Created directory '/home/pi/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/pi/.ssh/id_rsa.
Your public key has been saved in /home/pi/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:5s/lSMpU7gFcGYEEqOemcpctzr2h1oROisbEFot/r38 710437653@qq.com
The key's randomart image is:
+---[RSA 2048]----+
| ..o..o. |
| . . o |
| . o |
| .. . . . |
|o oo . S . |
|.= = .o + |
|+o * =. o + . |
|oo=.Boo+E* = |
|.o ====oo = . |
+----[SHA256]-----+

查看自己的公钥

pi@raspberrypi:~ $ cat /home/pi/.ssh/id_rsa.pub

运行效果:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCodo81VEoEeLcX15cjYtaFBpU7jxqII9niGyccEWuVf5jjLyCMqT/WD4ru1yXmxA5XPgCSpriflf3zqkqzybRiFERQP0G4OHZBoHCWsamNEv1Ohs1mHTzQ0t8Ko2DCTps1EEo2vtMHMNpCqBXo05/LjEF/jzA9k0GYMI73XjeI/bI/mZFi+wJpF8flyf7mbK别看我的看你自己的44kHUxWKI1a9EL/vqMz+4YTsWvOKtURuRVRE/v0XRPufwKKtHcOV35EWQrxamvqhXcJmv5RBFWvRUpLvkx2wUXyplSpARBFpdEbuSf1JDH77VClr00396czTTszQW6o8zQX3VnGdXHw1TrA/kv/ 710437653@qq.com

在github官网配置SSH and GPG keys

找到Personal settings -> SSH and GPG keys -> New SSH key

Title : 填写自己易于理解的标题

key : 填写上面公钥内容

点击 Add SSH Key

校验树莓派的认证是否成功

pi@raspberrypi:~ $ ssh -T git@github.com

运行效果:

The authenticity of host 'github.com (192.30.255.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.255.112' (RSA) to the list of known hosts.
Hi proschan! You've successfully authenticated, but GitHub does not provide shell access.

打完收枪!

结束

多半查找度娘上具体linux的配置,如果纰漏请联系我(710437653@qq.com),感谢谢谢Thank you~!

本博客来自https://chanchifeng.com/2018/06/12/raspberrypi-git/

[七月挑选]树莓派Raspberrypi上配置Git的更多相关文章

  1. 在香蕉派的树莓派系统上配置 Syncthing 自启动

    在香蕉派的树莓派系统上配置 Syncthing 自启动 —— 魏刘宏 2020 年 1 月 19 日 首先做个名词解释,” 香蕉派” 是国内一款山寨树莓派的硬件产品,” 树莓派系统” 指的是”rasp ...

  2. windows上配置git

    windows上配置git1.下载mysisigit进入http://msysgit.github.io/,下载,安装,下一步下一步即可. 2.下载tortoisegit进入http://downlo ...

  3. 本地Linux服务器上配置Git

    当我们需要拉取远程服务器代码到本地服务器时,我们首先要确定已经配置了正确的Git账号,可以从~/.gitconfig文件(为隐藏文件,需要使用ls -a查看),以及~/.ssh下的id_rsa.pub ...

  4. coding上创建项目、创建代码仓库、将IDEA中的代码提交到coding上的代码仓库、Git的下载、IDEA上配置git

    文章目录 一.Git的安装以及子啊IDEA上配置Git(下载好的可以跳过) 二.怎样让IDEA和Git建立关系 三.在coding上创建项目 四.在coding上创建代码仓库 五.Git工作理论 六. ...

  5. 图解如何在Linux上配置git自动登录验证

    记录一下配置git操作远程仓库时的自动验证,效果如下图: 本文介绍的是Linux下的配置.Windows上默认已经启用凭证存储和自动验证(依靠wincred实现,以后会使用GCM-Core). 准备工 ...

  6. 【玩转Ubuntu】04. Ubuntu上配置git环境

    1. 使用PPA安装Git PPA,表示 Personal Package Archives,也就是个人软件包集. 有很多软件因为种种原因,不能进入官方的 Ubuntu 软件仓库. 为了方便 Ubun ...

  7. Idea项目上传git(与git结合使用)

    Prerequisite(前提): 1.拥有github账号 2.本地电脑安装git 3.拥有一个guthub的新仓库 一.本地git与github安全连接(若已经将本地git与github建立连接, ...

  8. phpstorm配置git并解决Terminal 中文乱码(Unicode 编码)的方法

    前言:在使用PHPstorm的时候,需要用到terminal,主要还是用这个操作git,但是在使用这个的时候会发现,代码里所有中文都是乱码状态,不利于使用,下面就来看看怎么解决这个问题 一.先在php ...

  9. 在Ubuntu 18.04上安装Git

    步骤1.首先,通过运行以下命令确保您的系统和apt包列表完全更新: apt-get update -yapt-get upgrade -y 第2步.在Ubuntu 18.04上安装Git. 现在让我们 ...

随机推荐

  1. 限制 button 在 3 秒内不可重复点击

    在下载或者上传文件过程中避免重复点击带来的多次同样的请求造成资源浪费,限制 button 的点击次数是很有必要的. 1. 增强用户体验,2. 减轻服务器压力. HTML 代码 <button i ...

  2. Linux vi/vim and linux yum 命令

    Linux vi/vim 所有的 Unix Like 系统都会内建 vi 文书编辑器,其他的文书编辑器则不一定会存在. 但是目前我们使用比较多的是 vim 编辑器. vim 具有程序编辑的能力,可以主 ...

  3. BZOJ 2716 [Violet 3]天使玩偶 (CDQ分治、树状数组)

    题目链接: https://www.lydsy.com/JudgeOnline/problem.php?id=2716 怎么KD树跑得都那么快啊..我写的CDQ分治被暴虐 做四遍CDQ分治,每次求一个 ...

  4. ubuntu16虚拟机迁移/移动/复制后无法上网

    修改grub配置 如果没有网卡,需要配置 sudo vi /etc/default/grub 将 GRUB_CMDLINE_LINUX="" 修改为 GRUB_CMDLINE_LI ...

  5. 不能访问windows installer服务

    xp系统安装msi类型的安装程序出现以下错误: 不能访问windows installer服务. 解决办法 1:运行cmd -> regsvr32 msi.dll 运行services.msc- ...

  6. nginx中lua动态返回文件

    原来还可以这么操作,lua动态获取内容然后返回,下面是实例,可以做到先返回一个字符串,然后过5秒再返回另外一个字符串 ngx.say("hello") ngx.flush(true ...

  7. container_of宏解析 && 为什么需要使用中间变量__mptr?

    #define container_of(ptr, type, member) ({ \ )->member ) *__mptr = (ptr); \ (type *)( (char *)__m ...

  8. 八、SpringBoot生产环境部署

    1.下载安装Tomcat 下载地址:https://tomcat.apache.org/download-90.cgi 如下图所示: 2.入口类继承SpringBootServletInitializ ...

  9. 《Using Python to Access Web Data》Week4 Programs that Surf the Web 课堂笔记

    Coursera课程<Using Python to Access Web Data> 密歇根大学 Week4 Programs that Surf the Web 12.3 Unicod ...

  10. 11 ORA-8102:Index Corruption解析

    11 ORA-8102:Index Corruption解析 [oracle@DSI ~]$ oerr ora 810208102, 00000, "index key not found, ...