Skip to content

Instantly share code, notes, and snippets.

@sprobejames
Created March 19, 2024 23:33
Show Gist options
  • Select an option

  • Save sprobejames/0d64bb79121ff77b7fd42145407028e2 to your computer and use it in GitHub Desktop.

Select an option

Save sprobejames/0d64bb79121ff77b7fd42145407028e2 to your computer and use it in GitHub Desktop.
Bash script to clone a template and merging the commit history into one.
#!/bin/bash
# Create Empty Directory
mkdir -p FOLDER_NAME
cd FOLDER_NAME
git init
git fetch --depth=1 -n REPO_REMOTE_ORIGIN
git reset --hard $(git commit-tree FETCH_HEAD^{tree} -m "Initial Commit")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment