iT邦幫忙

3

git-如何修改gitHub裡面的程式碼又不添加commit紀錄的方法

小弟不小心留了帳號密碼連結的程式碼想改掉gitHub又不留commit紀錄
請問如何修改gitHub裡面的程式碼又不添加commit紀錄的方法?

git reset HEAD~
修改程式
git add XXX
git commit
git push 你的分支 -f
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

2 個回答

4
dragonH
iT邦超人 5 級 ‧ 2019-10-29 20:44:37
最佳解答

git reset

git rebase

參考

本月發生 A用B電腦 結果是C身分的認證
一樣輸入A的email password
結果多了一個 contributor C
/images/emoticon/emoticon10.gif

dragonH iT邦超人 5 級 ‧ 2019-10-30 10:17:24 檢舉

/images/emoticon/emoticon17.gif

感謝 dragonH

1
甲土豆
iT邦新手 5 級 ‧ 2019-10-30 09:17:03

使用指令 git commit --amend 修改最後一次提交紀錄
之後 git push 上去

感謝 甲土豆帥哥

我要發表回答

立即登入回答