Reputation: 9627
i've started development of some little project and did not use feature branches. now i would like to release a little part of this project, because it's stable enough to get released. what i would like to do is:
create a "release" branch with only the commits of this part of the project and ideally remove the other parts completly from the history of this branch.
is there any way to do this?
UPDATE
i think i forgot an important information: i would then like to push the release branch to e.g.: github or some other open hosting platform. because of this, i would like to have the history of the deleted files removed.
thanks very much!
Upvotes: 1
Views: 611
Reputation: 1324576
Removing files from the history means:
git filter-branch
(as in "Detach subdirectory into separate Git repository" and "how can I remove the unwanted objects from my repo after filter-branch --subdirectory-filter
")So if you have already published your repo on GitHub, such an operation (pushing a new history) needs to be planned in order for your collaborators to be able to take the changed history in to account (like in RECOVERING FROM UPSTREAM REBASE or the git rebase
man page).
Upvotes: 2
Reputation: 93024
You can create a branch and remove every file which is unneeded afterwards. The removed files will be still available in the other branches.
Upvotes: 0