在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