Commit graph

5 commits

Author SHA1 Message Date
Daniel Barber
f07398b032 No primary branch reference is an error 2020-06-17 17:07:23 -04:00
Daniel Barber
5a10c0c096 Get the name of the main branch from remote 2020-06-17 17:07:23 -04:00
Daniel Barber
69a95f60ea Accept optional branch name
There's been a recent movement to rename the "master" branch in git
repositories to "main" to avoid to potentially problematic word
"master". Our `merge-branch` script was hard coded to "master". This PR
makes it possible to pass in the name of the branch you wish to merge
to. I've defaulted it to "master" for now, but I expect in time this
will change.
2020-06-17 17:07:23 -04:00
Geoff Harcourt
0786549686 merge-branch: exit 1 if origin and local differ
This change prevents chained commands from continuing execution if the
`git merge` is operation would be unsuccessful such as a common
operation when a feature branch is ready to be merged and pushed:

```
git merge-branch && git push origin
```

If the origin/master and the local master have any difference, we return
status 1 and stop execution rather then emit a false success.

h/t: @croaky

Fix #563.
2017-12-18 22:51:13 -05:00
Dan Croak
24b34d1bec Move Git aliases to subcommand scripts
Any executable script on you PATH
that is named `git-some-name`
will be available as a git subcommand,
which means you could do `git some-name` to run the script.

Git adds them to `git help -a` under the title
"git commands available from elsewhere on your $PATH",
which will then power the auto completion,
so that will also work for any command you add.

http://blog.zamith.pt/blog/2014/11/05/supercharging-your-git/

Examples of other projects that structure their dotfiles like this:

https://github.com/robbyrussell/oh-my-zsh
https://github.com/tj/git-extras
https://github.com/holman/dotfiles
2015-04-27 13:47:52 -07:00