Skip to content

Instantly share code, notes, and snippets.

@joschuck
Last active March 20, 2018 12:02
Show Gist options
  • Select an option

  • Save joschuck/82ca9b0b72617b90dea2 to your computer and use it in GitHub Desktop.

Select an option

Save joschuck/82ca9b0b72617b90dea2 to your computer and use it in GitHub Desktop.
git log
# checkout specific version of file
git checkout f08a63ff4fa7b8479f8c698e5998ee1afcac3a4e kitti_to_tfrecords.py
git config user.name "Johannes Schuck" && git config user.email mail@joschuck.de
#!/bin/sh
# Not tested
# get filenames
git log --name-status --grep='keyword' | grep -e '^[A,M]\s' | cut -c3- > ~/tmp.txt
# create directories
mkdir ~/tmp
xargs -n 1 dirname < ~/tmp.txt | xargs -I {} mkdir -p ~/tmp/{}
# copy files
cat ~/tmp.txt | xargs -I {} cp {} ~/tmp/{}
#remove tmp file
rm ~/tmp.txt
git log -1 --format=%cd
git diff -- file1 file2 folder1/*.py
sed -n "\$a[file]" >> .gitignore
git rm --cached [file]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment