Skip to content

Instantly share code, notes, and snippets.

@deebs67
Last active March 15, 2020 15:04
Show Gist options
  • Save deebs67/d6bbb228590812ecb6634ae4dafa92db to your computer and use it in GitHub Desktop.
Save deebs67/d6bbb228590812ecb6634ae4dafa92db to your computer and use it in GitHub Desktop.
Some useful notes on using git

Git notes

This is a gist to capture useful notes on using git.

N.B. There's a good Github tutorial on Youtube at: https://www.youtube.com/watch?v=0fKg7e37bQE

Some git commands which I have found to be useful are:
git branch # To find what branch you are on
git branch -a # To list all branches
git status
git add -A
git commit -m "some commit message"
git push
git checkout -- filename # To restore a file which has been deleted
git checkout some_branch # Check out branch 'some_branch' (i.e. switch to that branch)
git merge some_branch # Merge branch 'some_branch' into the current branch (e.g. master)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment