- Topic-B depends on Topic-A
- Topic-A has updates
- Topic-B want Topic-A updates by replacing old merge to have clean graph
(topic-b)$ git tag "outdated"
(topic-b)$ git reset --hard master #if master is parent of Topic-B
(topic-b)$ git merge --no-ff topic-a
(topic-b)$ git tag "updated"
(topic-b)$ git reset --hard outdated
(topic-b)$ git rebase --onto updated {old_topic_A_merge_sha1}
Remove Helper Tags
(topic-b)$ git tag -d updated
(topic-b)$ git tag -d outdated
open .git/config
[alias]
# Pull updates from topic dependency
# usage: git topicpull {topic} {sha1 merge in topic} {master}
topicpull = "!f() { git tag \"outdated\"; git reset --hard ${3:-master}; git merge --no-ff $1; git tag \"updated\"; git reset --hard outdated; git rebase --onto updated $2; git tag -d updated; };f"