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 log outputs in a specific revision range

A revision is specified by its SHA1 hash. If you want to see commits for specific files, you have to separate paths with –: git log oldhash..newhash — path/to/inspect does this. Also note that you are using three dots (…) to specify the range. Usually, you only want two dots. Three dots might not give … 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 to ignore a file which is already committed?

As mentionned in “ignoring doesn’t remove a file “ (the following quote the great article from Nick Quaranto, in his blog git ready “learn git one commit at a time”): When you tell Git to ignore files, it’s going to only stop watching changes for that file, and nothing else. This means that the history … Read more

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