Skip to content

Commit

Permalink
feat(up, start): prefer upstream remote over origin
Browse files Browse the repository at this point in the history
  • Loading branch information
jlegrone committed Sep 8, 2018
1 parent b17fad0 commit c4015e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ script:
- yarn commitlint-travis
- yarn install --production
- git aliases
- GIT_REMOTE=$(git upstream-or-origin) && [ "$GIT_REMOTE" = "origin" ]
- node lib/remove-config.test
after_success:
- yarn install --ignore-scripts
Expand Down
3 changes: 2 additions & 1 deletion commitizen.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ const scopes = [
'log',
'status',
'branch-name',
'develop-branch'
'develop-branch',
'upstream-or-origin'
].map(name => ({ name }));

module.exports = {
Expand Down
7 changes: 5 additions & 2 deletions src/jlegrone.gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
# Update your current branch from develop
# ** Rewrites history **
# Usage: git up
up = "!git pull --rebase --autostash origin $(git develop-branch)"
up = "!git pull --rebase --autostash $(git upstream-or-origin) $(git develop-branch)"

# Start a feature branch based off of latest develop branch
# Usage: git start <name-of-feature>
start = "!sh -c \"git checkout $(git develop-branch) && git pull && git cb feature/$1\" -"
start = "!sh -c \"git checkout $(git develop-branch) && git up && git cb feature/$1\" -"

# Start a hotfix branch based off of latest master branch
# Usage: git hotfix <name-of-production-patch>
Expand Down Expand Up @@ -86,3 +86,6 @@

# Get the develop branch (used in other aliases)
develop-branch = "!(git show-ref --quiet refs/heads/develop && echo develop) || echo master"

# Get remote name (prefer upstream over origin)
upstream-or-origin = "!(git remote | grep upstream) || echo origin"

0 comments on commit c4015e0

Please sign in to comment.