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

170 questions
28
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
  • 739
  • 2
  • 10
  • 11
23
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
  • 10,213
  • 2
  • 37
  • 62
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
  • 8
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
  • 33,335
  • 48
  • 165
  • 292
19
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
  • 4,353
  • 3
  • 37
  • 63
17
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
  • 6,933
  • 5
  • 46
  • 67
17
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
  • 10,076
  • 10
  • 54
  • 116
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,174
  • 7
  • 24
  • 39
16
votes
2 answers

git status takes too long

I'm working on a project where the version control system is SVN and I want to use git. I did a git svn clone but git status works terribly slow (around 8 minutes). The repository has around 63000 files and most of them are libraries ignored by git.…
Jacob Krieg
  • 2,430
  • 10
  • 60
  • 114
15
votes
6 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,496
  • 10
  • 32
  • 47
15
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
  • 84,226
  • 27
  • 133
  • 175
12
votes
5 answers

"git status" in brief or short format like "ls -1"?

I need to take a bunch of files that have changed and scp them to different boxes for testing. I'm having trouble figuring out how to make git status give me a listing like ls -1 so I can script the actions with minimal effort. I have an existing…
jww
  • 83,594
  • 69
  • 338
  • 732
12
votes
1 answer

Git: how to create different unmerged states?

When do different git status unmerged states occur, like added by us, added by them or both deleted? I've tried to reproduce the latter by performing a merge where a file has been deleted in the current and merged-from branch, but I was not able to…
mklhmnn
  • 3,930
  • 2
  • 14
  • 8
11
votes
3 answers

Why does "git status" show way too much untracked files?

Answer in the bottom. I am trying to see the status of my files in the git_test2 directory which contains 3 files named test1.txt, test2.txt and test3.txt. This is what I typed into Terminal: cd Desktop cd git_test2 git status Everything is good…
Ishay Frenkel
  • 319
  • 3
  • 16
10
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
  • 9,377
  • 11
  • 64
  • 111
1
2
3
11 12