Git – Undoing Changes: git checkout git revert git reset git clean

Git Undoing Changes git checkout git revert git reset git clean https://www.atlassian.com/git/tutorials/undoing-changes Whereas reverting is designed to safely undo a public commit, git reset is designed to undo local changes. Because of their distinct goals, the two commands are implemented differently: resetting completely removes a changeset, whereas reverting maintains the original changeset and uses a…

Read More

Extract directory, filename, and extension in Bash shell

Extract directory, filename, and extension in Bash shell https://stackoverflow.com/questions/965053/extract-filename-and-extension-in-bash $> FILE_PATH=”dir/example.tar.gz” $> FILE=”example.tar.gz” $> dirname $FILE_PATH dir $> dirname $FILE . $> basename $FILE_PATH example.tar.gz $> basename $FILE example.tar.gz # ——————————- # dir/example.tar(.gz) : $> echo “${FILE_PATH%.*}” dir/example.tar # dir/example(.tar(.gz)) : $> echo “${FILE_PATH%%.*}” dir/example # example.tar(.gz) : $> echo “${FILE%.*}” example.tar # example(.tar(.gz)) :…

Read More