github新建仓库上传本地项目

官网注册账号 https://github.com/ 创建仓库

设置仓库名,描述、类型:

打开本地项目的文件夹,除了代码等必要文件外,一个良好的习惯是添加下面几个文件。README.md:项目的说明文档。LICENSE:许可。从随便一个别人的库里下载,将 Copyright 行修改为自己的时间和名字即可。.gitignore:指明无需上传的文件和子文件夹。

在项目文件夹中右键,选 Git Bash Here
执行命令:

git init
git add *
git commit -m "first commit"
git remote add origin https://github.com/ubluofu/CodeSource.git
git push -u origin master

期间如果提示:git config --global user.email "you@example.com"
git config --global user.name "Your Name" 则分别设置好对应的邮箱和用户名


提交成功,这样在github上就能看到你自己提交的项目了:

添加项目成员:生成公钥 可以一直默认选项 设置公钥路径 c/Users/Administrator/.ssh/id_rsa(默认) 密码不输入则为空

 ssh-keygen -t rsa -C "luo1554100681@163.com"

github添加项目成员并且验证公钥 点击头像->setting->SSH AND GPGKeys->new sshKey 把本地生成的公钥id_rsa.pub拷贝到这里(注意有的公钥后面如果有换行要去掉)

原文地址:https://www.cnblogs.com/leifonlyone/p/12827685.html