Necrolyte2
Necrolyte2

Reputation: 748

Is there a way to get git status to show 2 remotes

Is there a way to get git status to show 2 remotes?

Basically I have origin set to the Fork of a github project and upstream to the Fork's parent project. On the github page for my Fork it lists something like this

This branch is 1 commit ahead, 9 commits behind othergithubuser:master

Essentially, I'm looking for git status(or some way) to replicate this

.git/config

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = https://github.com/mygithubuser/project.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[remote "upstream"]
    url = https://github.com/othergithubuser/project.git
    fetch = +refs/heads/*:refs/remotes/upstream/*

Upvotes: 6

Views: 117

Answers (2)

CodeWizard
CodeWizard

Reputation: 142542

What you are asking isn't supported in GIT yet.

When you run git status its comparing your current working directory & index against the current HEAD.

Keeping the above in mind we can see that git doesn't care where the content came from or will it be pushed to. Its like that by design.

If you stop for a moment and you think about it it makes sense that git status has no clue from where and to where the code will go to.

Upvotes: 1

Ducky
Ducky

Reputation: 2754

Type git help status in the terminal and see the command description, you would see that you can't do so at the moment

Displays paths that have differences between the index file and the current HEAD commit, paths that have differences between the working tree and the index file, and paths in the working tree that are not tracked by Git (and are not ignored by gitignore(5)). The first are what you would commit by running git commit; the second and third are what you could commit by running git add before running git commit.

Upvotes: 0

Related Questions