创建ssh-key 并且重命名
cd ~/.ssh
ssh-keygen -t rsa -C "example@example.com"
ssh-keygen -t ed25519 -C "your_email@example.com"
on Windows:
eval `ssh-agent -s`
将ssh-key添加到ssh agent
ssh-add example
配置,将不同账号与ssh-key关联
vim config
Host example
Hostname github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/example
在git服务器上添加公钥
cat example.pub
测试
ssh -T example
Common Usage
zip branch
git archive -o v0.0.1.zip main
Create empty branch
git switch --orphan <new branch>
git commit --allow-empty -m "Initial commit on orphan branch"
git push -u origin <new branch>
Submodule
git submodule add <remote url> <local url>
git submodule add https://github.com/tatamobile/pelican-boostrap5.git themes/pelican-bootstrap5
git submodule update --init
git submodule update --init --recursive
用zip加密压缩文件和目录
zip -e -r keys.zip keys
Comments