安装清华源 sed -i 's@packages.termux.org@mirrors.ustc.edu.cn/termux@' $PREFIX/etc/apt/sources.list 安装主题(171-85-14) pkg install curl && . <(curl -L l.tmoe.me/ee/zsh) -y 自定义键盘⌨️通过编辑~/.termux/termux.properties配置 extra-keys = [\ [\ {key: ESC, popup: {macro: "CTRL f d", display: "tmux exit"}},\ {key: '~', popup: '-'},\ {key: LEFT, popup: HOME},\ {key: DOWN, popup: PGDN},\ {key: KEYBOARD, popup: {macro: "CTRL d", display: exit}},\ {macro: "ALT j", display: A-j, popup: {macro: "ALT g", display: "%g"}},\ {key: HOME, display: "🏠" , popup: {macro: "CTRL d b", display: " "}},\ {key: UP, popup: PGUP},\ {key: END, popup: HOME},\ {key: ':wq', popup: ":q!"}\ ],\ [\ {key: ' -a', popup: ' -A'},\ {key: '(', popup: '<'},\ {key: ')', popup: '>'},\ {key: dd, popup: {macro: ' ~/gitdemo/_posts ENTER',display: " 📲"}},\//进入仓库文本编辑区 {key: '[', popup: '{'},\ {key: ']', popup: '}'},\ {key: LEFT, popup: HOME},\ {key: ENTER, display: "✌" , popup: {macro: "ESC u", display: "↶"}},\ {key: RIGHT, popup: ">>"},\ {key: BKSP, display: "🔙" , popup: {macro: "XINHAO_HAN_TextUT", display: "📝"}}\//第三方文本编辑软件 ],\ [\ 'TAB',\ {key: CTRL, popup: {macro: "CTRL c", display: "✋"}},\ {key: ALT, popup: "&"},\ {key: "i", popup: "|"},\ {key: "'", popup: '"'},\ {key: '/', popup: {macro: "history -c ENTER", display: "🗑️"}},\//清除输入过的命令 {key: PGUP, display: "⇞ⓥ" , popup: "gg"},\ {key: DOWN, popup: PGDN},\ {key: PGDN, display: "ⓥ⇟" , popup: "W"},\ {key: DEL, display: "☠:", popup: ":"}\ ]\ ] pkg up 执行访问手机存储命令termux-setup-storage 安装git pkg install git 安装ssh pkg install openssh ssh-keygen -t rsa -C "sxgpyjg@qq.com" 获取ssh key公钥内容(id_rsa.pub)d ~/.ssh 复制该id内容!添加到GitHub公钥(参考图片) 验证是否设置成功 ssh -T git@github.com 安装git@github.com:sxgpyjg/sxgpyjg.github.io.git 链接 git config --global user.name "sxgpyjg" ~ $ git config --global user.email "sxgpyjg@qq.com" ~ $ 创建库 mkdir gitdemo ~ $ 进入库 cd gitdemo ~/gitdemo格式化 git init 关联远程库 git remote add gitdemo git@github.com:sxgpyjg/sxgpyjg.github.io.git 远程更改文件后下载库到本地 git pull --rebase gitdemo master //这条指令的意思是把远程库中的更新合并到本地库中,–rebase的作用是取消掉本地库中刚刚的commit,并把他们接到更新后的版本库之中。 git pull gitdemo master 备份termux “tar -zcf /storage/emulated/0/下载/download/termux-backup.tar.gz home usr” 恢复termux tar -zxf /storage/emulated/0/下载/download/termux-backup.tar.gz --recursive-unlink --preserve-permissions 备份键盘设置 cp ~/.termux/termux.properties ~/.termux/termux.properties.bak 库内编辑文件后 git add -A //提交所有变化 git add -u //提交被修改(modified)和被删除(deleted)文件,不包括新文件(new) git add . //提交新文件(new)和被修改(modified)文件,不包括被删除(deleted)文件 git commit -m 'first_commit' //提交到暂存区 git push gitdemo master //本地更改或添加文件后上传本地库到远程库 复制所有文件到 cp -r -a /storage/emulated/0/下载/download/_posts/* /data/data/com.termux/files/home/gitdemo/_posts 恢复键盘设置 cp -r -a /storage/emulated/0/下载/download/termux.properties /data/data/com.termux/files/home/ git 强制拉取覆盖本地 git reset --hard gitdemo/master 强推本地到远程库 git push -f gitdemo master </img> 回退到库 git reset --hard[版本号]//能覆盖文件 </img> 1.git log //查看版本号 2.git revert -n (版本号) </img> 1、多条执行 git fetch –all git pull 2、单条执行 git fetch –all && git reset –hard gitdemo/master && git pull