GitHub使用

来源:互联网 发布:类似按键精灵的软件 编辑:程序博客网 时间:2024/05/16 02:01

1、Git Windows 下安装

点击打开链接


2、ssh key生成

在Git Bash中输入

$ ssh-keygen -t rsa -C "your_email@youremail.com"

后面的your_email@youremail.com改为你在github上注册的邮箱,之后会要求确认路径和输入密码,我们这使用默认的一路回车就行。成功的话会在C:\Users\hemuye下生成.ssh文件夹,进去,打开id_rsa.pub,复制里面的key。
回到github上,进入 Account Settings(账户配置),左边选择SSH Keys,Add SSH Key,title随便填,粘贴在你电脑上生成的key。

为了验证是否成功,在git bash下输入:

$ ssh -T git@github.com

如果是第一次的会提示是否continue,输入yes就会看到:You've successfully authenticated, but GitHub does not provide shell access 。这就表示已成功连上github。

3、

$ git config --global user.name "Your Name"$ git config --global user.email "email@example.com"

4、上传

点击打开链接

$ git remote add origin git@github.com:yourName/yourRepo.git
$ git push origin master

5、删除

后两步一样  

$ git rm test.txt$ git commit -m "remove test.txt"

0 0
原创粉丝点击