Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Git merge submodule into parent tree and preserving commit history

1. git remote add -f Bproject /path/to/B
2. git merge -s ours --no-commit --allow-unrelated-histories Bproject/master
3. git read-tree --prefix=dir-B/ -u Bproject/master
4. git commit -m "Merge B project as our subdirectory"

5. git pull -s subtree Bproject master


# The explanation
1. name the other project "Bproject", and fetch.
2. prepare for the later step to record the result as a merge.
3. read "master" branch of Bproject to the subdirectory "dir-B".
4. record the merge result.

5. pull in subsequent update from Bproject using "subtree" merge
Comment

PREVIOUS NEXT
Code Example
Shell :: how to upgrade .rpm file in linux 
Shell :: brew moving from arm to intel 
Shell :: delete completed kubernetes jobs 
Shell :: Find all pods that status is NotReady jq cheatsheet 
Shell :: powershell remove remove startup text 
Shell :: Ubuntu software in 22.04 store does not use system theme 
Shell :: pushing things to git 
Shell :: command to push code to github 
Shell :: git clone with new name 
Shell :: install vue-router for vue 2 
Shell :: validate ssh key 
Shell :: ufw rules 
Shell :: cmake install files 
Shell :: gdal_translate kmz transparent nodata 
Shell :: terminal command remove recursive 
Shell :: git short version hash [by index] 
Shell :: installing appwrite on docker 
Shell :: bash find path of current script 
Shell :: http://archive.linux.duke.edu/ubuntu bionic/universe i386 libsndio6.1 i386 1.1.0-3 
Shell :: ansible tar with a datestamp 
Shell :: Multiple Sequential Commands in CRON Linux 
Shell :: how to make kali linux faster - To monitor preload’s log file 
Shell :: gnome tool for open pdf file from terminal 
Shell :: How to Loop through Array Elements 
Shell :: how to hash a password in bash script 
Shell :: install xinput 
Shell :: copy linux command with all hiden files 
Shell :: install openvino for ubuntu 20 
Shell :: install nheko 
Shell :: rebuild all apps dokku 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =