Skip to content

Instantly share code, notes, and snippets.

@Abhinav1217
Last active February 23, 2023 04:19
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 Abhinav1217/c7360b4abee9f3174e7d8c1567fcbc9e to your computer and use it in GitHub Desktop.
Save Abhinav1217/c7360b4abee9f3174e7d8c1567fcbc9e to your computer and use it in GitHub Desktop.
Some useful git snippets for lesser used tasks

Taken from https://gist.github.com/lttlrck/9628955
Rename a branch both locally and on server.

git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote


git log --oneline -10 # Managable git log. git update-index --skip-worktree # If you want to make an untracked local change (like personal editorconfig changes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment