Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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/*
like image 475
Necrolyte2 Avatar asked Nov 26 '14 14:11

Necrolyte2


People also ask

How do I view remotes in git?

Command #1: git branch -r This Git command will show you remote branches. The -r flag here is short for --remotes . This is the command I use personally.

What does git status show you?

The git status command displays the state of the working directory and the staging area. It lets you see which changes have been staged, which haven't, and which files aren't being tracked by Git. Status output does not show you any information regarding the committed project history.

How do I see statuses on github?

Use the git status command, to check the current state of the repository.


1 Answers

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.

like image 125
CodeWizard Avatar answered Sep 26 '22 02:09

CodeWizard