Skip to content

Instantly share code, notes, and snippets.

@abdul-alhasany
abdul-alhasany / commands.md
Created June 20, 2024 14:05
Add git submodule using sparse-checkout

Clone project with history only

cd <main-project-folder>

git clone --filter=blob:none --no-checkout --depth 1 --sparse <project-url>

Do sparse checkout

cd <folder-from-git-clone>

git sparse-checkout add <folder1> <folder2> ...

@abdul-alhasany
abdul-alhasany / branches-to-folders.sh
Created November 9, 2022 00:22
Pull all branches from remote and copy into separate folder for each one
#https://stackoverflow.com/a/65020975
git fetch --all --prune
# reset branch only if it has deviated from the remote
function update_branch {
if git diff --exit-code --quiet $1; then
echo "No changes on branch $1"
else
echo "Resetting branch $1"
This file has been truncated, but you can view the full file.
let typesList = [
{
"slug": "Anything",
"name": "Anything"
},
{
"slug": "String",
"name": "String",
"children": [
{