Git - Porting changes to the HEAD from an old branch -


i'm trying apply changes made in specific commit onto head of git repository. branch commit made in 2 years old , never merged main branch of repository few reasons.

however, there few changes made in commit i'd port over, in particular additions made 2 files: method signature added java interface , implementation in concrete class. no lines changed or removed 2 files.

my problem is, if try merge or cherry-pick commit onto current branch, sorts of conflicts, since commit old. in 2 files, lot of code has been changed in meantime, , git asks me if want lines in commit or lines have been added in past 2 years. i'd if git replay on head same additions made in commit, without replacing content.

in particular instance, being 2 files, can port on changes manually, wondering if missing specific git command/option automatically fix analogous situations.

thanks.

you can check out specific hunks file in commit:

git checkout -p <commit> -- <path/to/file> 

git go through differences in file between <commit> , head , ask whether want stage change or not. can quite overwhelming, though, depending on size of file , on how has changed.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -