我原先是用的別人的git倉庫,自己后來新建了一個逻淌,記錄下來git的步驟
首先是把原先項目里的.git文件刪除
然后在項目文件里運行命令:git init,會在你的項目文件里新生成一個.git文件
之后把你想要git到遠程倉庫的文件git add到緩存中(git add --all)
then,git commit -m 'first'提交到本地倉庫
last棠枉,git remote add origin https://github.com/xxxxx(設(shè)置git地址)
git push -u origin master
git push -f origin master(-force強制push)
##########
如果你設(shè)置了一個錯誤的地址明棍,可以使用下邊的命令修改
git remote set-url origin https://github.com/xxxxxxx/zzzzz