Git command line – know if in submodule?

(Update April 2017 for Git 2.13, Q2 2017) There is now an official command to determine if a repo is a submodule of a parent repo: cd /path/to/potential/submodule/repo git rev-parse –show-superproject-working-tree See commit bf0231c (08 Mar 2017) by Stefan Beller (stefanbeller). (Merged by Junio C Hamano — gitster — in commit 3edcc04, 17 Mar 2017) … Read more

git splitting repository by subfolder and retain all old branches

Short answer git filter-branch offers exactly the functionality you want. With the –subdirectory-filter option you can create a new set of commits where the contents of subDirectory are at the root of the directory. git filter-branch –prune-empty –subdirectory-filter subDirectory — –branches Walkthrough The following is an example to perform this in a safe way. You … Read more

How do I “git clone” a repo, including its submodules?

With version 2.13 of Git and later, –recurse-submodules can be used instead of –recursive: git clone –recurse-submodules -j8 git://github.com/foo/bar.git cd bar Editor’s note: -j8 is an optional performance optimization that became available in version 2.8, and fetches up to 8 submodules at a time in parallel — see man git-clone. With version 1.9 of Git … Read more

How can I use git-archive to include submodules from a bare repository?

Based on answers and comments here. You can create non-bare repo and run: git ls-files –recurse-submodules | tar caf ../prog.tar.gz -T- To handle files starting with hypen, use –verbatim-files-from To put files in folder inside the archive, use –xform s:^:prog/: Full version: git ls-files –recurse-submodules | tar caf ../prog.tar.gz –xform s:^:prog/: –verbatim-files-from -T-

Git submodules: specify a specific SHA?

Submodules, by definition, always reference particular SHA1 in the subproject. That SHA1 isn’t expressed in the .gitmodules file, but is instead expressed as the entry in the tree object that contains the submodule. The way you set this in git is by cding into the submodule, checking out the SHA1 you want, then cding back … Read more

Git submodules vs Nuget packages [closed]

I prefer using submodules over Nuget packages for frequently changing internal libraries. Here’s why: Merging: If several developers make changes to the same library at the same time, with submodules, these changes can be merged. With Nuget packages, obviously there’s no concept of merging. Less wait: With submodules, you push, and then pull with whatever … Read more

how to undo git submodule update

Run git checkout 025ffc in the submodule directory and then git add SubmoduleName; git commit -m ‘Some message’ in the main directory. (Remember that checking out a commit through its hash leaves you in “detached HEAD state”, meaning that you’re not on any branch. So if there already is a branch pointing to 025ffc in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)