Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Can I programmatically get the name of the remote branch which my local branch is tracking? I'm interested in scripting around git-range-diff(1), so that I could do something like this: [alias] ...
Question
git
#1: Initial revision
Get the name of the remote tracked branch of my local branch for use in script
Can I programmatically get the name of the remote branch which my local branch is tracking? I'm interested in scripting around git-range-diff(1), so that I could do something like this: ```gitconfig [alias] rd = range-diff master..REMOTE_BRANCH remote1/master..HEAD ``` and then be able to run on the command line `git rd` to get a range diff between the remote state of my branch and the local one (represented by HEAD). What should I put in REMOTE_BRANCH to make this work?