Termux 安卓上使用Git
- 安装必要的库:
pwd
默认路径在 com.termux/files/homepkg install git openssh curl [vim]
- 执行脚本,获取存储访问权限,同时选择字体和颜色
sh -c "$(curl -fsSL https://github.com/Cabbagec/termux-ohmyzsh/raw/master/install.sh)"
- 新建文件夹,用来存放公钥和git仓库:
mkdir .ssh mkdir repos
- 生成公钥:
ssh-keygen -t rsa -C "your_email"
- 将以下输出的公钥拷贝,并配置到到git仓库的公钥中
cat .ssh/id_rsa.pub
- 克隆代码:
cd repos git clone [your_repo] cd ..
- 将代码移到外部储存卡(如果需要外部访问的话),再建立一个软连接方便快速访问:
mv repos/ ./storage/shared/ ln -s ./storage/shared/repos ./repos
- 如果有提交代码的需求,配置下git
git config --global user.name "[your_user_name]" git config --global user.email "[your_email]"
参考:
https://zhuanlan.zhihu.com/p/32338964
转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 using1174@foxmail.com
文章标题: Termux 安卓上使用Git
文章字数: 221
本文作者: Jun
发布时间: 2019-03-01, 17:02:00
最后更新: 2019-03-01, 18:49:51
原始链接: http://yoursite.com/2019/03/01/Termux-安卓命令行工具/版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。