内容简介:以上命令基本够我用了参考:1、在gitbash中使用
| 命令 | 作用 |
|---|---|
| dd | 删除当前行,并把删除的行存在剪贴板 |
| yy | 拷贝当前行 |
| p | 粘贴剪贴板 |
| a | 在光标后插入 |
| o | 当前行后插入新行 |
| O | 当前行前插入新行 |
| 0 | 数字0,移动光标到行头 |
| ^ | 移动光标到首字符 |
| $ | 移动光标到行尾 |
| u | 撤回操作 |
| . | 重复上一次的命令(反撤回) |
| gg | 到文件头 |
| G | 到文件尾 |
| e | 按单词移动,到下一个单词的结尾 |
| / | 搜索,按n可以查看下一个 |
以上命令基本够我用了
比较实用的git命令
git branch dev git checkout dev git checkout -b dev git stash git stash list git stash apply git stash pop git log git reset - - hard HEAD^ git reset - - hard 1094a
生成两个ssh对应github和gitlab
1、在gitbash中使用 ssh-keygen -t rsa -C "公司邮箱地址"
生成对应的gitlab密钥: id_rsa
和 id_rsa.pub
2、将gitlab公钥即 id_rsa.pub 中的内容配置到公司的gitlab上
3、在gitbash中使用 ssh-keygen -t rsa -C "github地址" -f ~/.ssh/github_rsa
生成对应的github密钥: github_rsa
和 github_rsa.pub
4、将github公钥即 github_rsa.pub 中的内容配置到自己的github上
5、进入密钥生成的位置,创建一个 config
文件,添加配置:
# gitlab
Host gitlab
HostName git.xxx.com #这里填你的gitlab的Host
User git
IdentityFile ~/.ssh/id_rsa
# githab
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/github_rsa
以上所述就是小编给大家介绍的《常用vim及git操作》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Sprint
Jake Knapp、John Zeratsky、Braden Kowitz / Simon & Schuster / 2016-3-8 / GBP 14.60
媒体推荐 “Every business leader I know worries about the same thing: Are we moving fast enough? The genius of Jake Knapp’s Sprint is its step-by-step breakdown of what it takes to solve big problems an......一起来看看 《Sprint》 这本书的介绍吧!