Skip to content

Instantly share code, notes, and snippets.

@devkabiir
Last active November 26, 2020 08:45
Show Gist options
  • Save devkabiir/8ba92801377f09d4b66c0094193152b9 to your computer and use it in GitHub Desktop.
Save devkabiir/8ba92801377f09d4b66c0094193152b9 to your computer and use it in GitHub Desktop.
Git link folder from another repo #git #git-link #git-add #git-folder #git-file
  1. Add the repo as a git submodule
git submodule add <url>
  1. Initialize and update the submodule to the latest changes
git submodule init

git submodule update


# this will fetch and merge the lates changes from remote repo
git submodule update --remote --merge
  1. Commit the newly added .gitmodules and a repo_name.diff
  2. To update in future follow commands from step 2

Relavent link on SO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment