Skip to content

Instantly share code, notes, and snippets.

@nicopace
Created January 18, 2019 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicopace/b98c5c9d99e0a14c64b361522de3dc25 to your computer and use it in GitHub Desktop.
Save nicopace/b98c5c9d99e0a14c64b361522de3dc25 to your computer and use it in GitHub Desktop.
Freeze directories in a repository to a specific commit
git clone github.com/librerouterorg/openwrt.git
cd openwrt
wget https://gist.github.com/nicopace/b98c5c9d99e0a14c64b361522de3dc25/raw/56f58460366adb8ef0d9c6a678ab2190dc4b5784/freeze-directories.sh
wget https://gist.github.com/nicopace/b98c5c9d99e0a14c64b361522de3dc25/raw/56f58460366adb8ef0d9c6a678ab2190dc4b5784/freezed-directories
./freeze-directories.sh
#!/bin/bash
cat freezed-directories | while read -r line; do
DIRECTORY=`echo $line | cut -d\ -f1`
COMMIT=`echo $line | cut -d\ -f2`
git reset $COMMIT -- $DIRECTORY;
done
package/network/utils/arptables c7c1cf5618b6ca983c20510814b762eeab4937e5
package/network/utils/curl ea22e3df3eb017840d90d4150a149400b1965724
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment