git上传本地项目到远程仓库

在本地写了一个小demo,或者练手了一个项目,这个时候想要将他上传至自己的github,该怎么办呢?

1. 首先你要有一个本地git

​ 参考: Windows安装git

2. 将本地的SSH公钥信息配置到你的github中,也可参考上面的链接

3. 你要有一个自己的仓库(自行百度)

4. 在本地项目建立git仓库

  • 进入项目文件夹,比如你的项目叫abc,那么点开这个文件夹
  • 右键-Git Bash here,输入命令: git init

5. 本地仓库关联远程仓库

Git Bash 中输入 : git remote add origin [email protected]:hello-u/hong.git

注意后面的 [email protected]:hello-u/hong.git 换成你自己的仓库的地址

6.这个时候就可以用你的idea上传项目了
  • git --add
  • git-commit ,请详细写明每次提交之前做了什么
  • git-featch
  • merge
  • git-push

7. 如果用命令的话,在git bash中的命令是

echo "# test" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin [email protected]:hello-u/test.git
git push -u origin master

猜你喜欢

转载自blog.csdn.net/weixin_33781606/article/details/87490320