aurora
aurora

Reputation: 9627

git removing commit history of some files from a branch

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

Answers (2)

VonC
VonC

Reputation: 1324576

Removing files from the history means:

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

fuz
fuz

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

Related Questions