-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitconfig.aliases
19 lines (19 loc) · 1.23 KB
/
gitconfig.aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[alias]
# to update a bad commit message
amend = commit --amend
# adds, commits, and pushes, with multiple messages (m flags) allowed!
acp = "!f() { git add . && git commit -m \"$@\" && git push; }; f"
# creates a new branch, checks out to it, and then pushes it to GH (while setting the upstream)
nb = "!f() { git checkout -b \"$@\" && git push -u origin \"$@\"; }; f"
# switches to dev branch, deletes the old [feature] branch given as an argument, deletes the branch on GH as well, and then pulls any merged changes from development
db = "!f() { git checkout development && git branch -d \"$@\" && git push -d origin \"$@\" && git pull; }; f"
# conveniently removes files added to git without deleting them locally
rmc = "!f() { git rm -r --cached \"$@\"; }; f"
# pushes to heroku remote's master for an updated deploy from given branch
ph = "!f() { git push heroku \"$@\":master; }; f"
# the next 3 are for migrating and seeding the production database
migrate = "!f() { heroku run knex migrate:latest; }; f"
rollback = "!f() { heroku run knex migrate:rollback; }; f"
seed = "!f() { heroku run knex seed:run; }; f"
# PRs from the command-line via hub: https://hub.github.com/
pr = "!f() { hub pull-request -b development -c -F pr.md; }; f"