Skip to content

Instantly share code, notes, and snippets.

View andreabradpitto's full-sized avatar
:octocat:

Andrea Pitto andreabradpitto

:octocat:
View GitHub Profile
<#
.SYNOPSIS
Perform Git submodule update to any commit and/or branch.
.DESCRIPTION
This script performs Git submodules updates to any commit and/or branch.
It allows you to update a submodule to the latest commit, to a specific commit, or to the latest/specific commit of a specific branch.
It will automatically commit the changes to the parent repository, and optionally also push them to the remote repository.
.PARAMETER pathToLocalRepo
<#
.SYNOPSIS
Perform Git sparse checkout programmatically.
.DESCRIPTION
This script performs a sparse checkout of a Git repository, allowing you to clone only specific subfolders instead of the entire repository.
It uses the `git sparse-checkout` command to specify which subfolders to include in the local clone.
.PARAMETER repoUrl
Mandatory parameter; it is the repository URL that will be `git clone`d.
@andreabradpitto
andreabradpitto / gist-ssh-cloning-guide.md
Created October 12, 2022 15:18
A simple guide that explains how to correctly clone a GitHub Gist via SSH

How to clone a Gist via SSH

Rules to follow
  1. The user is git (as with "standard" www.github.com GitHub repositories)

  2. The domain is gist.github.com

  3. The author's name is not present

@andreabradpitto
andreabradpitto / img_collector.ps1
Last active August 3, 2022 20:25
A simple PowerShell script I made for fun/learning, that automates image collection from folders which contain potentially any file type. The collected images are then stored together in a separated folder
# --------------------
# Author: Andrea Pitto
# Created: 05/05/2022
# --------------------
# --- PURPOSE ---
# This script picks all and only the .png/.jpg/.jpeg images from all the first level sub-folders
# of a determined source folder ($src_folder_name), and it then copies them inside
# another dedicated destination folder ($dest_folder_name).
# The script does not overwrite image files as, before each copying attempt,