Skip to content

Instantly share code, notes, and snippets.

@adrienjoly
Last active December 5, 2021 11:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrienjoly/247cc114db9bb47d4f0788a6af9435b7 to your computer and use it in GitHub Desktop.
Save adrienjoly/247cc114db9bb47d4f0788a6af9435b7 to your computer and use it in GitHub Desktop.
Commands to run in order to make sure that you're not going to delete changes or files that were not pushed yet to your remote git repository.
git fetch
echo "\nStashes:"
git stash list | cat
echo "\nLocal branches + their associated remote:"
git branch -vv | cat
echo "\nCommits not yet pushed, from all branches that are already on remote:"
git log --branches --not --remotes | cat
echo "\nFiles that only exist locally (e.g. .env files):"
git status --ignored | grep -v ".DS_Store"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment