Git Cards - Keynote Format

1,750 views

Published on

Deck for studying up on Git commands.

This was purposefully kept free of any styling etc as this is the actual deck I use for memorization and don't like distractions.

0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,750
On SlideShare
0
From Embeds
0
Number of Embeds
40
Actions
Shares
0
Downloads
38
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide
  • Git Cards - Keynote Format

    1. 1. Initialize a new git repo in the current working directory.
    2. 2. git init Initialize a new git repo in the current working directory.
    3. 3. Clone an existing git repo.
    4. 4. git clone <clone_url> Clone an existing git repo.
    5. 5. Show history of changes.
    6. 6. git log Show history of changes.
    7. 7. Show changes to tracked files.
    8. 8. git diff Show changes to tracked files.
    9. 9. Show a list of changed files in the working directory.
    10. 10. git status Show a list of changed files in the working directory.
    11. 11. Add a new file to the current repo.
    12. 12. git add <path/file> Add a new file to the current repo.
    13. 13. Stage all new files and changes to tracked files for the current repo.
    14. 14. git add . Stage all new files and changes to tracked files for the current repo.
    15. 15. Stage all removed files and changes to tracked files for the current repo.
    16. 16. git add -u Stage all removed files and changes to tracked files for the current repo.
    17. 17. Stage all added files, removed files and changes to tracked files for the current repo.
    18. 18. git add -A Stage all added files, removed files and changes to tracked files for the current repo.
    19. 19. Commit all your local changes.
    20. 20. git commit -a Commit all your local changes.
    21. 21. Amend your most recent commit with the current changes.
    22. 22. git commit --amend Amend your most recent commit with the current changes.
    23. 23. Mark a version or milestone.
    24. 24. git tag v1.0 Mark a version or milestone.
    25. 25. Fetch from origin and fast forward your changes on top of it.
    26. 26. git pull --rebase Fetch from origin and fast forward your changes on top of it.
    27. 27. Push committed to changes to origin.
    28. 28. git push Push committed to changes to origin.
    29. 29. Discard all uncommitted changes in your working tree. Cannot be undone.
    30. 30. git reset --hard Discard all uncommitted changes in your working tree. Cannot be undone.
    31. 31. Reset an individual file back to HEAD.
    32. 32. git checkout <path/file> Reset an individual file back to HEAD.
    33. 33. Switch branches.
    34. 34. git checkout <branch_name> Switch branches.
    35. 35. List all local branches for the current repo.
    36. 36. git branch List all local branches for the current repo.
    37. 37. List all remote branches for the current repo.
    38. 38. git branch -r List all remote branches for the current repo.
    39. 39. Delete a local branch.
    40. 40. git branch -d <branch> Delete a local branch.
    41. 41. Delete a remote branch.
    42. 42. git branch -d -r <branch> Delete a remote branch.
    43. 43. Merge branch1 into branch2
    44. 44. git checkout branch2 git merge branch1 Merge branch1 into branch2
    45. 45. Create new_branch based on old_branch and switch to it.
    46. 46. git checkout -b new_branch old_branch Create new_branch based on old_branch and switch to it.
    47. 47. Stash uncommitted changes in current working tree.
    48. 48. git stash Stash uncommitted changes in current working tree.
    49. 49. Apply stashed changes to current working tree.
    50. 50. git stash pop Apply stashed changes to current working tree.

    ×