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
3
votes
2 answers

gitignore with platform specific defines?

I'm working on Fedora 22. When I perform a git status it lists all the *.o files. I don't recall seeing the behavior in the past. I looked at the project's .gitginore file delivered via git clone, and it lacks a rule for *.o. I would like to add…
jww
  • 97,681
  • 90
  • 411
  • 885
3
votes
1 answer

Git status upstream and downstream

I can run these commands and get expected output $ git branch --track test $ git checkout test $ touch hello.txt $ git add hello.txt $ git commit -m hello.txt $ git status On branch test Your branch is ahead of 'master' by 1 commit. However here is…
Zombo
  • 1
  • 62
  • 391
  • 407
3
votes
3 answers

how to make git ignore ignores in .gitignore

I have a Git repository that contains a .gitignore file, which lists a few files (that are created during the build) to be ignored. $ cat .gitignore foo $ ls bar $ git status On branch master nothing to commit, working directory clean $ touch foo $…
umläute
  • 28,885
  • 9
  • 68
  • 122
3
votes
1 answer

Files marked as 'Deleted' are reported as 'Missing' in LibGit2Sharp

When viewing my repository status with Git Bash I can see many files that are marked as 'Deleted'. LibGit2Sharp RepositoryStatus reports these files as "Missing". The RepositoryStatus object also has a collection "Removed". What is the difference…
Nick
  • 19,198
  • 51
  • 185
  • 312
2
votes
1 answer

subprocesses from apache returning exit code -6 with not stdout or stderr

When running "git status" or even "ls" from an apache process, I will frequently get no standard output or error, and an exit status code of -6. Other times, it just works. Any ideas why this is occurring or what it means?
BrainCore
  • 5,214
  • 4
  • 33
  • 38
2
votes
3 answers

The correct way to use Git?

I have a bin/ folder with tons of Bash, Python scripts and some C code. In this folder, I did: git init git add file_name I thought git add . would not be good because it would think that all the different scripts and programs were part of the…
userend
  • 1,701
  • 1
  • 13
  • 10
2
votes
3 answers

Git: Ignoring directories only if they have no tracked files

I have a git repository, and I want git status to ignore all directories (and everything below) if I haven't added files in the directory yet. Adding /* to .gitignore almost does the trick. I can create new directories, put files in them, and git…
Andres Riofrio
  • 9,851
  • 7
  • 40
  • 60
2
votes
2 answers

Practical Git example (git status does not show untracked/changed file)

I'm currently reviewing Practical Git by Johan Abildskov in preparation for an upcoming job. The first example I came across seems to be impossible. Here's how it starts: $ ls A B C D $ git status On branch master nothing to commit, working tree…
NaNCat
  • 119
  • 1
  • 6
2
votes
3 answers

How to use ANSI 256-color in .gitconfig

I am trying to set up custom colors for git status, as described here While using predefined color names works: [color "status"] changed = yellow normal using ANSI 256 color codes does not work: [color "status"] changed = "\033[38;5;214m"…
400 the Cat
  • 266
  • 3
  • 23
2
votes
2 answers

Is it possible NOT to show changes from a specific folder for git status?

Here is the situation, say I would like to track files in **/data but do not want to see their status (because there are too many files and I generally do not care the details there), is it possible? It would be even better if I could be shown a…
zyy
  • 1,271
  • 15
  • 25
2
votes
2 answers

How to loop git status using scripting

I need a help with this: I want to loop the git status code without status code or together status code in one line; I'm using the code below: # file.sh files=$(git status --porcelain) for file in $files; do echo $file done #…
2
votes
5 answers

How can I use "git status" to see only certain type of files?

When I use 'git status', it shows me all the modified files. But I wish to see only files with a certain extension (like .py) which I will commit. Is there a way to do this?
2
votes
1 answer

.gitignore and untracked files are shown in git status

I am getting wierd scenario on Centos 7.5.1804 with git 1.8.3.1. I have .gitignore as *.pyc but git status showing following $ git status # On branch master # Untracked files: # (use "git add ..." to include in what will be committed) # # …
Shashwat Kumar
  • 5,159
  • 2
  • 30
  • 66
2
votes
1 answer

Bash - Get only directory names from git status

I just need the directory names from the git status. As a short form when I use git status -s, I get the following output. M stack/pipeline.yaml ?? stackother/ Whereas I just need stack/ and stackother/ as a list or just as an output which I can…
Biplob Biswas
  • 1,761
  • 19
  • 33
2
votes
2 answers

Git says up to date although changes were made remotely

Using git bash: I worked on my master branch, pushed it and decided I want to implement a new feature. I created a new branch for that. Later I added another feature, creating yet another branch. I tested everything and it was working, so I decided…
idkfa
  • 159
  • 1
  • 6