Posts for: #Git

How to list all the git commits history for a specific file

Assuming the following situation: You work on a large project that has an extensive git commits history and a lot of files You need to debug a certain issue that was caused by a certain file You look at the commits history to see which commit is causing the issue but going through it one by one is like finding a needle in a haystack Well, worry not because you can use the following git log command to solve your issue:
Read more

How to Clone a Git Repository With Submodules

Today I learned how to git clone a repository that has git submodules inside of it. I realized that when I cloned a project it will clone the parent repo but the submodules will be empty. Here are the steps on how to clone it properly. If you haven’t cloned the repository yet, you can use --recurse-submodules option: $ git clone --recurse-submodules https://github.com/sample/sample-repo.git Otherwise, If you already cloned the project then you can use the following command.
Read more