Git 的一点基本使用

版权声明:版权有就有吧。 https://blog.csdn.net/m0_38044453/article/details/83108767

一、为什么学习Git

  1. 牛逼的互联网,牛逼的大神们都在用

  2. 完整的版本控制功能,解决多人协作的问题

  3. 提高开发效率

  4. 如果你是程序员,请务必学习Git,并习惯把自己的代码同步到GitHub上

Git不等于GitHub!Git和github就是球和球场的关系。

二、Git安装

1、下载windows git

Msysgit  https://git-scm.com/download/win  

2、配置用户信息

- git config --global user.name “zhangsan”

-git config --global user.email [email protected]

--global 针对所有的用户

客户端gui界面

SourceTree

直接百度即可百度。

三、git仓库

1、初始化版本库

-- git init

2、添加文件到版本库

-- git add

--git commit

3、查看仓库状态

-git status

扫描二维码关注公众号,回复: 3760848 查看本文章

四、远程仓库

  1. 创建ssh key

ssh-keygen -t rsa -C [email protected]

 

邮箱为注册github的邮箱。

一直点回车键

生成sshkey

一般存放在用户下的目录中

选择id_rsa.pub,输入 cat id_rsa.pub

就可以看到key;

 

 

 

把上面的key复制到这里。

 

可以通过 ssh -T [email protected] 来测试是否联通github

 

  1. 添加远程仓库

git remote add orgin [email protected]:tylerdemo/demo4.git

git pull origin master --allow-unrelated-histories

git push -u origin master

 

 

 

 

猜你喜欢

转载自blog.csdn.net/m0_38044453/article/details/83108767