git的基本用法

// 创建SSH Key
$ ssh-****** -t rsa -C "[email protected]"

// 查看全局配置
$ git config --list

// 查看具体配置(如:用户名、邮箱)
$ git config user.name
$ git config user.email

// 修改全局配置
$ git config --global user.name 'xxxxx'
$ git config --global user.email '[email protected]'



 

 

注意点:

git的基本用法

  • git fetch是将远程主机的最新内容拉到本地,用户在检查了以后决定是否合并到工作本机分支中。

git pull 则是将远程主机的最新内容拉下来后直接合并,即:git pull = git fetch + git merge,这样可能会产生冲突,需要手动解决。

git fetch origin <分支名> 后,可通过git merge origin <分支名> 合并分支。

  • git clone会拉取所有分支,可随意切换分支来获取指定远程分支的内容。