git环境搭建

1、根据开发环境判断是否需要实现安装git

$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo apt-get install openssh-client
$ sudo apt-get install git-core
$ sudo apt-get install curl

2、生成公钥,用于系统认证

$ ssh-keygen -t -rsa                 //一路回车到底
$ cd ~/.ssh                          //查看是否生成公私钥对(id_rsa.pub、id_rsa、know_hosts)

3、在$HOME/.shh目录下创建config文件

$ touch ~/.ssh/config

4、将以下内容添加到config文件中

$ touch ~/.ssh/config
$ chmod 644 ~/.ssh/config
$ vi ~/.ssh/config            //增加如下内容,注意修改自己的名字,若有新服务器添加,末端添加即可             
host 服务器地址
Hostname服务器地址
Port 29418
User 自己的名字
PubkeyAuthentication yes
IdentitiesOnly yes
PasswordAuthentication no
IdentityFile ~/.ssh/id_rsa
 
host 服务器地址			//有新的服务器就继续在下面添加
Hostname 服务器地址
Port 29418
User 自己的名字
PubkeyAuthentication yes
IdentitiesOnly yes
PasswordAuthentication no
IdentityFile ~/.ssh/id_rsa

5、将之前生成的公钥添加到Gerrit系统中

$ cat ~/.ssh/id_rsa.pub		//注意*.pub后缀的公钥文件,选择公钥内容并拷贝

(1)登录服务器页面 (这里以github为例)

(2)选择用户,进入设置模式  

(3)选择ssh key,添加新的公钥

 

  

(5)查看开发服务器权限

$ ssh -T git@github.com

      

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
OpenWRT是一个轻量级的嵌入式Linux发行版,适用于诸如路由器、防火墙等设备。LuCI(Lightweight User Interface Configuration)是一个为OpenWRT构建的Web管理界面框架。如果你想在本地开发OpenWRT的LuCI代码,你需要设置一个基本的Git开发环境。以下是搭建步骤: 1. **安装Git**: 确保你的系统已经安装了Git。如果你使用的是Linux或macOS,可以使用包管理器(如apt-get或brew)安装。 ```bash sudo apt-get install git # 对于Debian/Ubuntu brew install git # 对于macOS ``` 2. **克隆OpenWRT仓库**: 在你的开发目录下,使用以下命令克隆OpenWRT的主仓库和LuCI分支: ```bash git clone https://github.com/openwrt/openwrt.git cd openwrt git checkout -b luci-branch origin/luci ``` 3. **配置编译工具链**: 如果你需要自定义编译环境,确保安装交叉编译工具链,这通常根据你的目标硬件平台不同而异。OpenWRT有一个详细的文档指导:https://openwrt.org/docs/en/devel/developers_manual/compiling#cross-compilation 4. **获取LuCI源码**: 如果你想要单独管理LuCI的开发,可以在LuCI的GitHub上克隆: ```bash git clone https://github.com/LuaDist/luci.git luci ``` 5. **设置环境变量**: 配置你的系统路径,使得Git可以找到LuCI的源码: ```bash export PATH=$PATH:/path/to/luci ``` 6. **初始化项目**: 在每个仓库中执行必要的初始化步骤,比如`cd luci && make` 或 `cd openwrt && make package_luci-core` 7. **提交和同步更改**: 完成开发后,记得定期将更改提交到本地仓库,并将更改同步到远程仓库: ```bash git add . git commit -m "Your commit message" git push ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Enosji

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

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

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

打赏作者

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

抵扣说明:

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

余额充值