Simple github commands guide

when you want to check the difference between your file (OR you want to revert files to the original version):

  • Warning: This command is actually reverting, but read why I suggest this as diff check.

git checkout origin/master *

Wildcard works. * means you’re going to search every file.
If you want to do this to specific files, do like this:

git checkout origin/master code/*atmos*.dm

This will detect every dm files that have atmos:

(these are examples)

If you want to compare a single file, do this:

git checkout origin/master code/somepath/

  • WARNING: Again, doing this means you’re reverting the files to the master’s status. Make sure you made a commit before doing this, or you’ll lose the progress.

  • why do you use git checkout instead of git diff?

this is when you do git diff. This is bad to read to recognise the difference.
git checkout is actually reverting feature, but it’s incredibly good to compare what’s different.

When you want to bring someone’s branch into your branch:



  • You’re going to test Powerfulbacon’s code
  • their fork name is powerfulbacon
  • their branch name is dynamic_ship
  • then it becomes
    git pull dynamic_ship
    (of course, they should push that into github online)
  • ta-da, you pulled someone’s code!
  • You want to compare it with master? then git checkout origin/master * - It’s told at first.

Thank you for the guide dragon!