Difference between revisions of "Git status"

From wikieduonline
Jump to navigation Jump to search
Line 69: Line 69:
 
  Your branch is behind '[[origin/main]]' by 20 commits, and can be fast-forwarded.
 
  Your branch is behind '[[origin/main]]' by 20 commits, and can be fast-forwarded.
 
   (use "git pull" to update your local branch)
 
   (use "git pull" to update your local branch)
 +
 +
git status             
 +
On branch yourbranch
 +
Your branch is up to date with 'origin/yourbranch'.
 +
Changes to be committed:
 +
  (use "git restore --staged <file>..." to unstage)
 +
        modified:  main.tf
  
 
== Related terms ==
 
== Related terms ==

Revision as of 11:22, 19 January 2024

git status https://git-scm.com/docs/git-status
git status -v
git status -vvv
Steps: git add -> git commit -> git push

Examples

git status
On branch master
nothing to commit, working tree clean
git status -v
On branch your-branch
nothing to commit, working tree clean


git status
On branch master 

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   new_file_1.txt
	new file:   new_file_2.txt
	new file:   new_file_3.txt


git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean


git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   MyModifiedFile.txt
        modified:   MyOtherModifiedFile.txt

no changes added to commit (use "git add" and/or "git commit -a")


git status
fatal: not a git repository (or any of the parent directories): .git
git status
HEAD detached from origin/your-branch-name
nothing to commit, working tree clean
On branch feature/your-branch
Your branch is up to date with 'origin/feature/your-branch'.

Untracked files:
  (use "git add <file>..." to include in what will be committed) 

../../path/path4/

nothing added to commit but untracked files present (use "git add" to track)
On branch main
Your branch is behind 'origin/main' by 20 commits, and can be fast-forwarded.
 (use "git pull" to update your local branch)
git status               
On branch yourbranch
Your branch is up to date with 'origin/yourbranch'.
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   main.tf

Related terms

See also

Advertising: