I want to to merge a submodule till specific commit with the older version sub module which i made commits on and don't want it to get deleted
Asked
Active
Viewed 38 times
0
-
Make a new branch from the newer branch, and reset to the commit you want to revert to, and then merge on the older branch – Skywalker Sep 05 '18 at 02:36
-
ok , I think that will work thank you very much – A_S Sep 05 '18 at 02:56
-
There is a problem that when I pull to the branch it will merge with the old commits – A_S Sep 05 '18 at 03:18
-
Before I revert back to the point want – A_S Sep 05 '18 at 03:19
-
You can try this. This should definitely work in your case and without causing problems on merging. https://stackoverflow.com/a/2816728/5316422 – Skywalker Sep 06 '18 at 02:01
-
once you have the new branch, merge to that branch from the submodule branch that you want.. and you will have exactly what you want. then later when you want to merge it all, just merge this branch into main – Skywalker Sep 06 '18 at 02:02
1 Answers
0
The solution that worked best form me was
git fetch
git checkout FETCHED_HEAD
git checkout -b newbranch commitSHA1
git checkout master
git merge newbranch

A_S
- 45
- 1
- 5