git 一些命令記錄

若從github上下載一個repo,修改後想傳到自己的github上,並保留原作者的git記錄,可以這麼操作

git remote rm origin
git remote add origin https://github.com/account/repo-name.git

用命令刪除之前關聯的 GitHub 遠程倉庫,並重新關聯碼雲倉庫地址
然後使用命令 git push –u origin 分支名 推送分支代碼。

若該repo有其他分支如develop,可以這麼推送

git remote add develop https://github.com/account/repo-name.git
git push -u develop develop

參考

GitHub倉庫搬碼雲

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章