git status

> git status
On branch main
Your branch is ahead of 'origin/main' by 2 commits.
  (use "git push" to publish your local commits)

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:   part2.md

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

Archivos con cambios pendientes en rojo.

git status

> git add part2.md
> git status
On branch main
Your branch is ahead of 'origin/main' by 2 commits.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   part2.md

Archivos sin cambios pendientes en verde.

gitignore

.gitignore es una lista de archivos que git debería ignorar:

*.tmp
node_modules/
*.html

git diff

  • Compara dos commits
  • git diff 22bc48..48c0b5

git revert

  • Crea un nuevo commit que deshace un commit anterior.
  • git revert 48c0b5