提交代码到github

1. 下载gitgit

点击download下载便可。下载地址:https://gitforwindows.org/github

2. 注册githubwindows

github地址:https://github.com/ui

必定要记得注册的用户名,邮箱和密码。之后登陆github,以及提交代码都会用到。code

3. 初始化本地git仓库blog

新建一个目录(名字本身随便取)-------》进入目录-------》鼠标右键-------》在出现的菜单中,选择 Git Bash Here -------》进入git命令界面-------》执行git init命令rem

4. 建立文件,提交到本地仓库it

cuishuai01@SXS-A333-D MINGW64 /e/githubcode/oodb (master)
$ touch README                      #建立文件io

cuishuai01@SXS-A333-D MINGW64 /e/githubcode/oodb (master)
$ git add README                      #把文件添加到本地ast

cuishuai01@SXS-A333-D MINGW64 /e/githubcode/oodb (master)
$ git commit -m "first commit"                  #提交到本地仓库
[master (root-commit) d89af61] first commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README

cuishuai01@SXS-A333-D MINGW64 /e/githubcode/oodb (master)
$ git push -u origin master                    #push到远程分支
fatal: HttpRequestException encountered.
An error occurred while sending the request.
Username for 'https://github.com': cs-Hacker            #在这里要输入用户名(当时注册github的时候的用户名),输入以后按下回车,会提示输入密码,输入密码正确以后,就会push到远程的github分支了Counting objects: 6, done.Delta compression using up to 4 threads.Compressing objects: 100% (3/3), done.Writing objects: 100% (6/6), 465 bytes | 465.00 KiB/s, done.Total 6 (delta 0), reused 0 (delta 0)To https://github.com/cs-Hacker/oodb.git * [new branch] master -> masterBranch 'master' set up to track remote branch 'master' from 'origin'.

相关文章
相关标签/搜索