Git 学习及使用

2017-03-10  本文已影响8人  Steven054
风景.jpg

钩子:

gitdir=$(git rev-parse --git-dir); scp -p -P 29418 姓名
@xxx.xxx.xxx.xxx:hooks/commit-msg ${gitdir}/hooks/

一 、设置Git的user name和email:

$ git config --global user.name “user name"
$ git config --global user.email “your email”

二、生成SSH密钥过程:

生存密钥:

$ ssh-keygen -t rsa -C “your email”

按3个回车,密码为空。

Your identification has been saved in /home/tekkub/.ssh/id_rsa.

Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.

The key fingerprint is

得到了两个文件:id_rsa和id_rsa.pub;位于~/.ssh目录下

三、添加ssh密钥

四、复制代码:

1、clone代码 git clone git@xxxxx.git

git 常用命令
checkout 切换分支 
branch 创建分支
fetch 拉取分支 
merge 合并分支 
pull 拉取分支,相当于fetech + merge 
push 推送分支 

命令不要从这里复制,可能有中文符号!!!自己敲

上一篇 下一篇

猜你喜欢

热点阅读