github新建本地仓库,远程仓库基本用法

来源:互联网 发布:matlab gui编程例题 编辑:程序博客网 时间:2024/06/05 07:41

以下github给出的基本使用方法:

1 mkdir gitRepo
2 cd gitRepo
3 git init  #初始化本地仓库
4 git add xxx  #添加要push到远程仓库的文件或文件夹
5 git commit -m 'first commit'  #提交zhiqadd的文件
6 git remote add origin https://github.com/yourgithubID/gitRepo.git  #建立远程仓库
7 git push -u origin master #将本地仓库push到远程仓库

p.s. : 需要先在github手动创建repo

Create a new repository on the command line

git initgit add README.mdgit commit -m "first commit"git remote add origin https://github.com/yourId/repoName.gitgit push -u origin master

Push an existing repository from the command line

git remote add origin https://github.com/yourID/repoName.gitgit push -u origin master
原创粉丝点击