Git commands that I use enough that I decided to write them down.
Last active
June 17, 2016 18:48
-
-
Save morganestes/76fa910047ecc00e0557 to your computer and use it in GitHub Desktop.
Custom Git commands for bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
rename_branch() { | |
old_branch=$(git rev-parse --abbrev-ref HEAD) | |
new_branch=$1 | |
git branch -m "${1}" | |
git push origin --delete "${old_branch}" | |
git push --set-upstream origin "${new_branch}" | |
} | |
rename_branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git rev-parse --abbrev-ref HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment