如何将本地仓库上传到github,以及工作的情况

1.安装git

选择你喜欢的盘,傻瓜式安装

2.github

http://github.com

注册一账号 登录

 

3.github创建仓库

1.右上角 有个 + ,点开,选择 new repository

2.输入仓库名称 和描述,创建

 

4.将项目添加到本地仓库中

在你的项目中右键 -》git bash here

git add .  //添加所有文件
git commit -m "你的本次做了什么事情"
//如果是第一次使用git 需要配置一下个人信息
//git config --global user.email "11@qq.com"
//git config --global user.name "haomeili"

5.连接远程仓库

git remote add origin 你的仓库地址http://...

 如果出现:

$ git remote add origin 你的仓库地址http://...

fatal: remote origin already exists.

就先移除当前的连接:

   git remote rm origin

再重新连接

   $ git remote add origin 你的仓库地址(http://...)
往下依次执行

推送到远程仓库

git push -u origin master

询问你的github的账号和密码,输入即可

6.down项目

git clone 你的仓库地址(http://...)

7.下班

git add . 
git commit -m "描述"

git pull //如果一旦有变化,那么需要重新 add commit pull
git push

8.上班

git pull

 

原文地址:https://www.cnblogs.com/ximenchuifa/p/13823487.html