Questions tagged [git-status]

Shows which files in a Git repository have been modified and/or staged and what state they are in since the last commit

This is the main tool in to see the status of the files on the stage and what state they are in.

Running this command will tell you what tracked files have been added, deleted or modified since the last commit.

On a fresh repo or branch, you should see the following:

$ git status
# On branch master
nothing to commit (working directory clean)

See also

References

197 questions
47
votes
10 answers

git: programmatically know by how much the branch is ahead/behind a remote branch

I would like to extract the information that is printed after a git status, which looks like: # On branch master # Your branch is ahead of 'origin/master' by 2 commits. Of course I can parse the output of git status but this is not recommended…
Olivier Verdier
  • 46,998
  • 29
  • 98
  • 90
46
votes
3 answers

How can I get content of a file from git index?

I have a file which has been already added to my local repository. I've modified it in the working tree, so git status shows me the file as modified. I would like to know what is the file content kept in the index before I stage the file. I can…
zaza
  • 1,379
  • 2
  • 13
  • 21
42
votes
6 answers

git status shows modifications even with autocrlf=false

I'm experiencing the same issues as in this question: git status shows modifications, git checkout -- doesn't remove them Git continues to show working directory modifications, even with git config --global core.autocrlf…
codekaizen
  • 26,990
  • 7
  • 84
  • 140
32
votes
3 answers

How not to display the .class in git

I don't want to display .class files when executing git status. I created a file named .gitignore and entered the .class in the file but nothing happened. What is the best way to prevent the .class file from being displayed when you execute git…
Rodel Sarate
  • 819
  • 3
  • 11
  • 11
26
votes
3 answers

Git enumerates nonexistent untracked files slowly

I am using git for source control on a repository. Recently it has begun warning me about how long it takes to enumerate untracked files when using git status: $ git status On branch my_branch Changes not staged for commit: (use "git add…
ravron
  • 11,014
  • 2
  • 39
  • 66
26
votes
4 answers

error: The following untracked working tree files would be overwritten by checkout

When I do git status it says nothing to commit, working directory clean And then I do git pull --rebase, it says: First, rewinding head to replay your work on top of it... error: The following untracked working tree files would be overwritten by…
randomor
  • 5,329
  • 4
  • 46
  • 68
24
votes
3 answers

git status for a past commit?

how to do a git status to view changed files in a past commit? NOTE: this question might have already been asked, but phrased much differently. however, I am astounded to see that searching for the following expression on Google yields no useful…
Guillaume Chevalier
  • 9,613
  • 8
  • 51
  • 79
22
votes
1 answer

Why doesn't "git status" display unpushed commits in a branch?

Everything is in the title... I read this question: Viewing Unpushed Git Commits But I don't understand why git status displays all unpushed commits in the master branch, but does not display anything in other branches. Can someone explain…
Aurelien
  • 277
  • 2
  • 9
21
votes
7 answers

How to exclude unwanted folders content to be shown when I execute 'git status' command

I'm trying to avoid showing unwanted folder's content (ex:- .settings, .metadata etc ) when i execute git status command. I modified .gitignore file after adding the folder names to it but still I'm getting all these files when I execute git status.
Raj
  • 1,467
  • 3
  • 23
  • 51
21
votes
3 answers

Git: automatic fetching from remote repositories?

One irritating thing I find about using command line Git is having to manually sync my repository with remote repositories. I constantly get tripped up by commands like "git status" that I (mistakenly) expect to report the difference between my…
Steve Bennett
  • 114,604
  • 39
  • 168
  • 219
20
votes
4 answers

How can I restrict git status to regular files in the current directory only?

I would like to see the status of the current directory. Because there are lots of changes in sub-directories, which I do not want to see, the following command doesn't do the trick: git status . Is there any way of getting this kind of report,…
blueFast
  • 41,341
  • 63
  • 198
  • 344
20
votes
3 answers

How can I make git-status check two different remotes?

Every git user is accustomed to this: > git status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean However, recently I've started working with two remotes instead of one (heroku and…
Max Yankov
  • 12,551
  • 12
  • 67
  • 135
18
votes
7 answers

How to remove deleted files from showing up in my local git status?

A developer added an image directory on the server without adding that folder to the .gitignore file. When I did a git pull it pulled those files (hundreds of files). I added the folder to the .gitignore on the server but not my local system. I then…
uwe
  • 3,938
  • 11
  • 37
  • 50
17
votes
3 answers

Check if git status is clean inside a Powershell script

I'm developing a Powershell script for create a program release. In order to do it I want to check if the git working tree is clean and there are no uncommitted changes. I've read this post but it's related to bash. How can I check from inside a…
Jepessen
  • 11,744
  • 14
  • 82
  • 149
16
votes
5 answers

git untracked files - how to ignore

When I run git status, I see the "Untracked files" section has many files (some with a "." extension.) I don't think I have to do anything, but it doesnt look good to see these files whenever I run git status. Is there any way to not to see these…
JDesigns
  • 2,284
  • 7
  • 25
  • 39
1
2
3
13 14