3 ms·
.gitconfig: [alias] add-commit = !git add -A && git commit .bash_profile: function save () { git add-commit -m "$*" && git push } Use like:
by user3939382 4y ago
.gitconfig:
[alias]
add-commit = !git add -A && git commit
.bash_profile:
function save ()
{
git add-commit -m "$*" && git push
}
Use like:
$ save This is a commit message
This adds changed files to a commit with this message and pushes it to remote.
Also:
alias mkpr='git push && gh pr create -d -f -B develop | grep https | xargs printf -- '%s/files' | xargs open'
Open a PR from current branch based on develop and open it in GitHub in my browser.
Merge upstream changes from develop:
alias mduc='CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) && git checkout develop && git pull && git pull --tags && git checkout ${CURRENT_BRANCH} && git merge develop'
I have a few more, whereby I skip most of the ceremony with git. Works for me.
- afefers 4y agoThose are really good! Thanks for sharing. Curious to see the others. Are they available somewhere?
- horsawlarway 4y agoCommit accepts the -A flag. You can simplify it to just function save () { git commit -am "$*" && git push }
- user3939382 4y agoYou can. I have it separate for the purpose of composition, sometimes I do 'gac Foo' which stands for 'git add commit' and I push later.