Linux-git安装
基本操作
- 安装
yum install git - 生成SSH KEY :先
cd ~/.ssh,在这个目录下输入ssh-keygen,一直回车就可以了,这个时候就会出现id_rsd.pub公钥和id_rsa私钥,然后cat id_rsa.pub,把这个公钥复制到对应的码云平台或者是github上,配置SSH Key - 基本命令
| git config | git init |
|---|---|
| git clone | git remote |
| git fetch | git commit |
| git rebase | git push |
- 此时就可以通过
git clone github上对应ssh连接,把代码克隆到本地了
学习网址http://www.runoob.com/git/git-tutorial.html
命令自动补全
- 下载源码 使用下载源码中的 git-completion.bash 自动补全命令的文件
git clone git@github.com:git/git.git,前提是你在github上配置了公钥 - 复制git-completion.bash 文件
cp contrib/completion/git-completion.bash /etc/bash_completion.d/ - 加载bash脚本
source /etc/bash_completion.d/git-completion.bash - 自动加载脚本,编辑
vim ~/.bash_profile,添加下面的就可以了
# Git bash autoload
if [ -f /etc/bash_completion.d/git-completion.bash ]; then
source /etc/bash_completion.d/git-completion.bash
fi
更多精彩

