Last active
March 20, 2018 12:02
-
-
Save joschuck/82ca9b0b72617b90dea2 to your computer and use it in GitHub Desktop.
git log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # checkout specific version of file | |
| git checkout f08a63ff4fa7b8479f8c698e5998ee1afcac3a4e kitti_to_tfrecords.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git config user.name "Johannes Schuck" && git config user.email mail@joschuck.de |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git log -1 --format=%cd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git diff -- file1 file2 folder1/*.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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