使用 Git Bash 配置用户名和命令别名
来源:互联网 发布:java 线程面试题 编辑:程序博客网 时间:2024/05/17 02:44
Download:Git for windows
1. 远程登录授权
Git使用SSH协议验证和登录远程服务器,所以首先需要生成SSH Key,并把Public Key添加到Github账户。
2. 检查SSH Key
检查本地是否已存在SSH Key:ls -al ~/.ssh
3. 生成新的SSH Key
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa
4. 添加SSH Key到Github账户
clip < ~/.ssh/id_rsa.pub
5. 测试连接
ssh -T git@github.com
6. 配置用户名和邮箱
git config --global user.name "your_name"
git config --global user.email your_email@example.com
git config --list
7. 配置命令别名
- git bash 清屏:编辑
D:\Program Files\Git\etc\profile.d\aliases.sh
,添加alias cls='clear'
- git 常用命令别名配置:
git config --global alias.st statusgit config --global alias.co checkoutgit config --global alias.ci commitgit config --global alias.br branchgit config --global alias.last 'log -1'git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
8. 使用教程
请参考廖雪峰的Git教程
阅读全文
0 0
- 使用 Git Bash 配置用户名和命令别名
- git config配置用户名和快捷命令(别名)
- git 命令别名配置
- 为git命令配置别名
- 如何配置git命令别名
- Git命令自定义别名配置
- bash命令别名和历史命令
- windows下 git 的 颜色 和 命令别名 的配置
- 通过 git bash 配置和使用 github
- GIT Bash保存用户名和密码
- bash特性之命令别名和命令引用
- 【Git笔记】使用技巧:命令自动补全及命令别名的配置方法
- 【Git笔记】使用技巧:命令自动补全及命令别名的配置方法
- git配置用户名和邮箱
- git 配置用户名和邮箱
- git配置用户名和邮箱
- 如何在使用Git Bash的时候不在输入用户名和密码
- Git Bash 配置与使用
- UVa 725 Division(暴力求解)
- git config
- 静态的html页面想要设置使用浏览器缓存
- Python 网络编程(套接字编程)
- generate-parentheses
- 使用 Git Bash 配置用户名和命令别名
- (Android网络4)Retrofit
- HDOJ HDU 1048 The Hardest Problem Ever
- <meta http-equiv="pragma" content="no-cache">属性http-equiv功能介绍
- eclipse下的UML妙用
- java String
- TCP和UDP的详细区别
- 动态广播注册源码分析
- RPG 游戏数值系统—1