Git for economists
  • Introduction
  • Git concept
  • Installing Git
  • Using Git for the first time
  • Using Remote Repository
  • Working with branches
  • Extra commands
  • Appendix - .gitignore file example
  • Page 1
Powered by GitBook
On this page

Was this helpful?

Extra commands

PreviousWorking with branchesNextAppendix - .gitignore file example

Last updated 1 year ago

Was this helpful?

Extra

git diff --no-index --word-diff old_file.txt new_file.txt

Ohter commands

[to sort]

hips://www.atlassian.com/git/tutorials

To stag a deleted file (the second option will only delete the file from git but will keep the local copy, for example, if a file type has been added to .gitignore, to delete files of this type already commited).

git rm foo
git rm --cached foo

git reset --hard <commit>

git reset --hard origin/master

Don't use git checkout but use git switch and git restore.

https://swcarpentry.github.io/git-novice/04-changes/