github - Creating a GIT project from specific commit of another GIT project -


my team has created gradel based spring git project lot of configuration. wondering if can save effort in creating new project require same configuration.

so planning checkout old commit of existing project, suppose c6. , create new project here.

a possible may be;

  1. checkout c6
  2. create new git repository.
  3. manually copy contents old repository , paste new repository
  4. change remote of new repository
  5. push changes of new repository

but not sure whether right approach , gonna work

please suggest me correct way achieve it.

you can clone repository , reset master c6

$ git reset --hard c6 

remove unwanted branches:

$ git branch -d branch_name 

there lot of dangling commits. check them with:

$ git fsck --no-reflogs 

and run these commands remove dangling commits:

$ git reflog expire --expire=now --all $ git gc --prune=now 

and remember delete remote origin, or able push/pull to/from other repository (considering code base not receive same updates):

$ git remote remove origin 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -