Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This needs a “git-track”. Make the current branch track the one in origin with the same name, if it exists


  [push]
    autoSetupRemote = true


In oh-my-zsh you have `ggsup` which is an alias for `git branch --set-upstream-to=origin/$(git_current_branch)`. `git_current_branch` is also a function that is bundled with oh my zsh.


Thanks. I found a way to do it with just git. No oh-my-zsh necessary:

git config --global alias.track '!git branch -u origin/$(git branch --show-current)'




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: