1
1
1nd1go2011-11-04 19:40:21
git
1nd1go, 2011-11-04 19:40:21

Local repo status in git

Greetings.

That's what interests. When I work with svn, I can clearly see the status of my working copy - dirty or not. I did not find this in the brunch gita.

Those. Let's say I have a working copy, I created two branches from it, committed different changes to each, left for a week, arrived and I need to push my changers to the team's central repository.

How can I know that I have unpublished changes in my local repository that are waiting to be committed. Do tortoisegit, idea plugin for git show such info?

Thank you.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
D
denver, 2011-11-05
@1nd1go

To find out what is not yet pushed (for the develop branch):

git log origin/develop..

To find out everything that is not yet pushed in all branches:
git log --branches --decorate --not --remotes=origin
# или поменьше воды, побольше инфы:
# git log --branches --decorate --not --remotes=origin --name-status --oneline

To see what hasn't been downloaded yet (for the develop branch):
git fetch
git log ..origin/develop
# или поменьше воды, побольше инфы:
# git log ..origin/develop --name-status --oneline

For simplicity, you can create yourself git in / git out aliases:
git config --global alias.in '!git remote update -p; git log [email protected]{u}'
git config --global alias.out 'log @{u}..'

@{u} - (only in git 1.7+) a variable referring to the remote branch for the current branch

D
Denis, 2011-11-04
@uscr

Either I did not understand anything, or you are talking about the git status command.

I
Infernal, 2011-11-04
@Infernal

git branch --no-merged will show those branches that have commits that are not merged into the current one. git status will show those changes in the working directory that are waiting to be committed + the number of commits not synchronized with the remote repository (assuming your local branch is tracking the remote one)

G
gooddy, 2011-11-04
@gooddy

If *nix/mac can be set to github.com/djl/vcprompt in PS$ and something like this will be shown, in the current directory you
image
can immediately see which version control system, the current branch, and there are a few more useful output format options ...

U
ultimate_darkness, 2011-11-04
@ultimate_darkness

You can write git diff --stat origin/master and get a list of changed files.

P
Puma Thailand, 2011-11-05
@opium

It seems to me that the methodology for working with the git in your head was not formed correctly.
In my opinion, everything should be like this
1) you commit everything you can to the local branch of the repository.
2) push to the main dev branch where all developers push.
3) if you push a conflict, you make a pool on yourself and resolve conflicts, then again step 2.
this does not take into account that there are separate branches for certain features, but there is about the same situation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question