GIt学习使用-使用git提交代码到github方法

1、首先需要访问:https://github.com/ 新建一个远程仓库,如下


2、进入到你需要提交到远程仓库的本地代码目录中


这个是我需要提交的项目,然后点击鼠标右键,如果你已经安装了git会找到,Git Bash Here然后点击打开git操作界面

3、执行以下命令,在本地连接到自己的远程仓库:

git remote add origin https://github.com/xiaochao321/mygc

4、然后提交本地代码到远程仓库中:

git push -u origin master

5、如果想从远程仓库克隆代码到本地,可以执行一下操作:

git clone https://github.com/xiaochao321/mygc.git

6、对代码进行了修改以后,可以使用一下命令进行提交:

git add .        (注:别忘记后面的.,此操作是把Test文件夹下面的文件都添加进来)

git commit  -m  "提交信息"  (注:“提交信息”里面换成你需要,如“first commit”)

git push -u origin master   (注:此操作目的是把本地仓库push到github上面,此步骤需要你输入帐号和密码)


猜你喜欢

转载自blog.csdn.net/scgyus/article/details/80213079