My team has created a gradel based spring GIT project with a lot of configuration. I was wondering if I can save my effort in creating new project require same configuration.
So I was planning to checkout some old commit of existing project, suppose C6. And create a new project from here.
A possible to do this may be;
But I am not sure whether it is a right approach and gonna work
Please suggest me a correct way to achieve it.
You can clone the repository and reset master to C6
$ git reset --hard C6
Remove unwanted branches:
$ git branch -D branch_name
There will be a lot of dangling commits. Check them with:
$ git fsck --no-reflogs
and run these commands to remove dangling commits:
$ git reflog expire --expire=now --all
$ git gc --prune=now
And remember to delete remote origin
, or you will be
able to push/pull to/from the other repository
(considering the code base will not receive the same
updates):
$ git remote remove origin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With