在github上新建项目ZJJCodeSnippetsgit
1.在本地目录CodeSnippets目录下初始化本地仓库github
git init
2.本地提交,code
git add . git commit -m "first commit"
3.添加远程关联ip
git remote add origin https://github.com/04zhujunjie/ZJJCodeSnippets.git
4.本地分支与远程分支关联,并推送到远程仓库rem
git push --set-upstream origin master
5.进行第4步操做后,会提示你输入用户名和密码get
Username for 'https://github.com':04zhujunjie Password for 'https://04zhujunjie@github.com':
以上5步能够完成本地仓库和分支与远程仓库和分支的关联.it