使当前提交成为Git存储库中惟一的(初始)提交? - Make the current commit the only (initial) commit in a Git repository?

问题:

I currently have a local Git repository, which I push to a Github repository. 我目前有一个本地Git存储库,我将其推送到Github存储库。 app

The local repository has ~10 commits, and the Github repository is a synchronised duplicate of this. 本地存储库有大约10个提交,而Github存储库是其同步副本。 ui

What I'd like to do is remove ALL the version history from the local Git repository, so the current contents of the repository appear as the only commit (and therefore older versions of files within the repository are not stored). 我想作的是从本地Git存储库中删除全部版本历史记录,所以存储库中的当前内容显示为惟一的提交(所以不会存储存储库中较旧版本的文件)。 this

I'd then like to push these changes to Github. 而后,我想将这些更改推送到Github。 spa

I have investigated Git rebase, but this appears to be more suited to removing specific versions. 我已经研究了Git变基,可是这彷佛更适合删除特定版本。 Another potential solution is to delete the local repo, and create a new one - though this would probably create a lot of work! 另外一个可能的解决方案是删除本地存储库,而后建立一个新的存储库-尽管这可能会致使不少工做! .net

ETA: There are specific directories / files that are untracked - if possible I would like to maintain the untracking of these files. 预计到达时间:有些特定的目录/文件没法跟踪-若是可能的话,我想保持对这些文件的跟踪。 ci


解决方案:

参考一: https://stackoom.com/question/ed3v/使当前提交成为Git存储库中惟一的-初始-提交
参考二: https://oldbug.net/q/ed3v/Make-the-current-commit-the-only-initial-commit-in-a-Git-repository
相关文章
相关标签/搜索