Skip to content

hosseinnarimanirad/GitTutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 

Repository files navigation

Git Tutorial

File/Change States

circle

  • untracked: new files in a directory that has not been tracked (excluding ignored files)
  • unstaged: new changes on tracked files that have not been staged or stashed
  • staged (new file): staged new files that does not exists in local or remote repository (e.g. using git add command)
  • staged: staged changes (excluding new files) (e.g. using git add command)
  • committed: new files or changes that have been committed (e.g. using git commit command)
  • published: pushed commits (using git push command)

How git commands affect files in git

Follow the colors to see how you can traverse between different states.

Example 1

Using git restore . discards changes on unstaged changes and does not affect untracked or staged, or committed changes.

Example 2

git reset --mixed HEAD~1 causes newly added files that have been staged to be untracked and also unstage all commited or staged changes

image

Full Version

image

About

Learn git commands

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published