Version 4 (modified by techene, 2 years ago) (diff) |
---|
Une métaphore amusante consiste à considérer Git comme un utilitaire de gestion des chronologies.
Where am I ? Bash hint !
parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
Useful links
https://git-scm.com/docs/git-commit
https://www.atlassian.com/fr/git/tutorials/undoing-changes
Useful commands
git-checkout
git checkout MY_BRANCH - Switch branches or git checkout old_commited_files.F90 restore working tree files https://git-scm.com/docs/git-checkout
git-restore
git restore deleted_file.F90 Restore working tree files git restore --source MY_BRANCH~2 file_before_last_2_commit.F90