Skip to content

Instantly share code, notes, and snippets.

@azizultex
Last active September 24, 2019 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azizultex/ea3d3dcd52a9710a88588e35c8dbb357 to your computer and use it in GitHub Desktop.
Save azizultex/ea3d3dcd52a9710a88588e35c8dbb357 to your computer and use it in GitHub Desktop.
Git commands
# Delete everything and upload new version
# resource: https://stackoverflow.com/questions/11071420/delete-everything-and-upload-new-version#11072408
git fetch
git merge -s ours origin/master --allow-unrelated-histories
git push origin master
# ignore remote files and push new files and updates to remote
git push --force origin master
# untrack all files if need to add a new file / folder to .gitignore and add new files and push to remote
git rm -r --cached .
git add .
git commit -m "your message"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment