1.登錄
先登錄github的賬號(hào)
2.new新建項(xiàng)目
3.上傳的項(xiàng)目
1)本地項(xiàng)目上傳
在此處右擊打開(kāi)git bash here
2)git 使用并上傳文件
git init//初始化
git add README.md//可以添加其他的文件
git add .//上傳全部文件
git commit -m "first commit"//備注
git branch -M main //建立新的分支
git remote add origin https://github.com/xxxx/xxx.git
git push -u origin main
補(bǔ)充
如果第一次使用git初始化需要設(shè)置名字和郵箱
git init
git config --global user.email address '郵箱'
git config --global user.name "名字"
4.分支操作和將修改后的項(xiàng)目提交到github
1)本地倉(cāng)庫(kù)創(chuàng)建新的分支
git branch dev
2)查看分支
git branch
3)以當(dāng)前分支為基礎(chǔ)創(chuàng)建dev1分支,我們也會(huì)進(jìn)入新的分支
git checkout -b dev1
4)切換到之前的main分支
5)刪掉特定的分支
git branch -D <branchname>
6)名稱(chēng)提交代碼先pull再push
git pull origin main
git push origin main
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-714884.html
5.回滾操作
文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-714884.html
1)將文件從暫存區(qū)回滾到工作區(qū)
git checkout 文件名稱(chēng)
2)將已經(jīng)提交到倉(cāng)庫(kù)的文件回滾到工作區(qū)
git reset HEAD^1
git checkout
到了這里,關(guān)于Github上建立新項(xiàng)目超詳細(xì)方法過(guò)程的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!