Noting down my experience of migrating Obsidian vault to git
Posts for: #Git
How to Stash Only Staged Changes in Git
Learn how to use Git stash to save only your staged changes.
How To Use Git Worktree To Checkout Multiple Branches At Once
Learn how to create and remove git worktree to simplify your PR workflow
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:
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.