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
2
votes
1 answer

Getting status of a different branch in git

I have a git repository that contains two branches, master and experiments. The latter contains experiments that do not belong in branch master, but may later be merged so I'd like to keep it up to date with changes made to master. To do so, I run…
Aimery
  • 1,559
  • 1
  • 19
  • 24
2
votes
1 answer

Aside from the resulting git tree structure, are there any important differences between git pull vs git fetch + git rebase?

I've worked on a dev team that preferred to use the method of git fetch and then git rebase rather than the method of git pull, before git pushing any changes to avoid merge conflicts. Is there a specific reason besides the difference in the visual…
Jasper
  • 23
  • 7
2
votes
2 answers

Git repo with submodules does not track local changes?

I have a git repository with 3 submodules, like this: foo/ # main repository bar1/ # submodule1 bar2/ # submodule2 bar3/ # submodule3 I've added the submodules directly after executing git init in the main repository: git submodule add…
daniel451
  • 10,626
  • 19
  • 67
  • 125
2
votes
1 answer

GitBash / GitExtensions issue committing local changes

I am a get newbie. I have completed development and ready to check in my files. I thought I checked everything in, but when I look at my repo, I see a sub-directory was not checked in. So I tried to force the git add . -f but I got this error: `$…
Robert Green MBA
  • 1,834
  • 1
  • 22
  • 45
2
votes
1 answer

How to get from working tree clean to working directory clean

After giving the Git command git status I am getting working tree clean instead of working directory clean. How do I get to working directory clean?
Kitty2
  • 21
  • 1
  • 3
2
votes
0 answers

Git status shows "fatal: bad object HEAD"

I have just done a git status and it's throwing the following error: fatal: bad object HEAD I have also tried git fsck which gives the following output: Checking object directories: 100% (256/256), done. error: HEAD: invalid sha1 pointer…
V4n1ll4
  • 5,973
  • 14
  • 53
  • 92
2
votes
2 answers

Git sees duplicated modified file

In my repository there is a file (always that one) that always gives me trouble. I'm working with coffeescript and generating the js with a grunt task. For several times git status told me that this file was modified and needed to be added. The…
Leonardo
  • 4,046
  • 5
  • 44
  • 85
2
votes
1 answer

Git status incorrectly saying files are deleted

I cloned a repository and edited exactly one file in it, tip.php, and then added it using git add. But when I next run git status I get the following: $ git status On branch removeRatings Changes to be committed: (use "git reset HEAD ..." to…
user1651576
  • 91
  • 1
  • 3
2
votes
2 answers

How to do 'git status' on untracked directory?

I have 6,000 untracked files in one subdirectory and I'm constructing .gitignore files to filter out the unwanted ones. I'm testing my gitignore filters as I go by running 'git status'. However, I have a larger number of untracked other files in a…
davidA
  • 12,528
  • 9
  • 64
  • 96
2
votes
1 answer

Where does git status get its information on changed files?

Git status gives information on the modified files in a repository (be in un-tracked or staged files) I want to be able to access these list of files -- to preform some code quality checks on those files before a commit is performed via. hooks Do…
Naveen Dennis
  • 1,223
  • 3
  • 24
  • 39
2
votes
2 answers

Is there a way to invoke a script on git status command?

I am managing my svn repositories as a git repo through git-svn tool, but there is no way to handle my svn externals. This problem is solved by treating each external as a git-svn repo. This is done using a script and the result is something similar…
coelhudo
  • 4,710
  • 7
  • 38
  • 57
2
votes
2 answers

Git: How to find whether origin/master is equivalent of (local) master?

git fetch goes over the network and fetches the latest snapshot from origin/master to the local host. It does not merge but just fetches the snapshot. Right after git fetch if we do git status, it will tell us whether (local) master is ahead or…
Sangeeth Saravanaraj
  • 16,027
  • 21
  • 69
  • 98
2
votes
1 answer

How is a pathspec supposed to work?

I am observing a strange behavior while using git-status with pathspecs. I would like your opinion on whether it is the expected behavior, or an undefined behavior in git. Initial setup $ mkdir main && cd main $ git init . Initialized empty Git…
yorah
  • 2,653
  • 14
  • 24
2
votes
2 answers

Convenient way to see what's new in remote repositories?

In Git, I'd like to be able to see, at a glance, whether my repository and working directory are out of date. I often make the mistake of just running "git status" - but that doesn't do any remote communication at all. Or, I'll do this: git fetch…
Steve Bennett
  • 114,604
  • 39
  • 168
  • 219
1
vote
1 answer

Removal of CR in Git repository not showing up in the git diff or git status

I fixed a file with CRLF issues be using the sed one liner: sed -i 's/^M//' However, this file is not showing up in the git status and the removal of the CR is not showing up in a git diff: git diff HEAD -- Just to make sure…
Hazok
  • 5,373
  • 4
  • 38
  • 48