GoConqr has a new look! Let us know what you think.

Flashcards

Git Commands

Maarten Van Doninck Information Technology English 35 cards

Cards in this deck (35)

  1. 1set a name that is identifiable for credit when review version historygit config --global user.name “[firstname lastname]”
  2. 2set an email address that will be associated with each history markergit config --global user.email “[valid-email]”
  3. 3set automatic command line coloring for Git for easy reviewinggit config --global color.ui auto
  4. 4initialize an existing directory as a Git repositorygit init
  5. 5retrieve an entire repository from a hosted location via URLgit clone [url]
  6. 6show modified files in working directory, staged for your next commitgit status
  7. 7add a file as it looks now to your next commit (stage)git add [file]
  8. 8unstage a file while retaining the changes in working directorygit reset [file]
  9. 9diff of what is changed but not stagedgit diff
  10. 10diff of what is staged but not yet commitedgit diff --staged
  11. 11commit your staged content as a new commit snapshotgit commit -m “[message]”
  12. 12list your branches. a * will appear next to the currently active branchgit branch
  13. 13create a new branch at the current commitgit branch [branch-name]
  14. 14switch to another branch and check it out into your working directorygit checkout [branch]
  15. 15merge the specified branch’s history into the current onegit merge [branch]
  16. 16show all commits in the current branch’s historygit log
  17. 17show the commit history for the currently active branchgit log
  18. 18show the commits on branchA that are not on branchBgit log branchB..branchA
  19. 19show any object in Git in human-readable formatgit show [SHA]
  20. 20delete the file from project and stage the removal for commitgit rm [file]
  21. 21change an existing file path and stage the movegit mv [existing-path] [new-path]
  22. 22show all commit logs with indication of any paths that movedgit log --stat -M
  23. 23Save a file with desired paterns as .gitignore with either direct string matches or wildcard globs.logs/
    *.notes
    pattern*/
  24. 24system wide ignore patern for all local repositoriesgit config --global core.excludesfile [file]
  25. 25add a git URL as an aliasgit remote add [alias] [url]
  26. 26fetch down all the branches from that Git remotegit fetch [alias]
  27. 27merge a remote branch into your current branch to bring it up to dategit merge [alias]/[branch]
  28. 28Transmit local branch commits to the remote repository branchgit push [alias] [branch]
  29. 29fetch and merge any commits from the tracking remote branchgit pull
  30. 30apply any commits of current branch ahead of specified onegit rebase [branch]
  31. 31clear staging area, rewrite working tree from specified commitgit reset --hard [commit]
  32. 32Save modified and staged changesgit stash
  33. 33list stack-order of stashed file changesgit stash list
  34. 34write working from top of stash stackgit stash pop
  35. 35discard the changes from top of stash stackgit stash drop

Information

Description
Information Technology Flashcards on Git Commands, created by Maarten Van Doninck on 19/12/2024.
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?