第1次下载git,上传一个本地项目到github,居然用了半天时间,赶紧总结分享下

 1  到git官网:https://git-scm.com/ 

如图:

上传本地项目到github上

点击如图的“Downloads for Windows”,进入如下界面:


上传本地项目到github上

点击桌面 “我的电脑” --> "右击" --> "属性",可以看到是32位还是64位系统,根据电脑系统选择。

下好之后会看到:

上传本地项目到github上

打开"Git Bash",如图:

上传本地项目到github上

注册好把ssh_key(相当于你的电脑和github建立连接的**)  

在git bash上敲命令:

ssh-****** -t rsa -C 'xxx你的邮箱@xxx.com'

cd ~/.ssh

上传本地项目到github上

pwd(查看当前文件位置)


2  打开github官网:https://github.com/,注册好账号

然后把"id_rsa.pub"里的内容,复制粘贴到github的**的地方,如图:

上传本地项目到github上



3  点击“New repository”,如图:

上传本地项目到github上

然后按照,下图步骤:

上传本地项目到github上

全部设完之后会跳转如下界面,这里画红圈的6条命令后面会用到(要记得):

上传本地项目到github上



4  从Git Bash里敲命令:

  到你要上传的文件夹下,例如:E:\git_demo  

上传本地项目到github上


命令:cd  'E:\git_demo',如图:

上传本地项目到github上

然后依次敲命令(上面提示用到的6条命令),第3条要改成(git add .):

echo "# led" >> README.md
git init
git add .(原来是git add README.md,但是发现只传上了RRADME.md,我们要传的是所有文件)
git commit -m "first commit"
git remote add origin [email protected]:cy-hello/led.git
git push -u origin master

如图:

上传本地项目到github上



5 到github上查看代码传上去没(花了一中午休息时间,终于写完了这篇博客,要吐血。。。)

上传本地项目到github上

相关文章:

  • 2021-09-15
  • 2021-11-30
  • 2021-06-13
  • 2021-04-16
  • 2021-12-26
  • 2021-07-14
猜你喜欢
  • 2021-09-14
  • 2020-10-08
  • 2021-05-17
  • 2021-08-01
相关资源
相似解决方案