$30 off During Our Annual Pro Sale. View Details »

Intro to Git/GitHub

Intro to Git/GitHub

Jogendra Kumar

February 09, 2019

More Decks by Jogendra Kumar

Other Decks in Technology


  1. None
  2. None
  3. Adeen Shukla | @adeen-s Student Developer Pack by The best

    developer tools, free for students education.github.com/pack
  4. Adeen Shukla | @adeen-s About Me • Adeen Shukla •

    Founder at codeIndore( ) • Open-source contributor at Jolla, MerMobile • / adeen-s • / AdeenShukla • adeen@adeen.me • https://adeen.me
  5. Adeen Shukla | @adeen-s About Me • Harshil • JavaScript

    Developer • Open-soure contributor • / harshil1712 • / a_harshil1712 • https://harshilagrawal.me
  6. Adeen Shukla | @adeen-s About Me • Jogendra Kumar •

    iOS Developer • Open-source contributor at FOSSASIA • / jogendra • / imjog24 • jogendra.iitbhu@gmail.com • https://jogendra.github.io
  7. Adeen Shukla | @adeen-s About Me • Manas Mangaonkar •

    / Pac23 • / pa_c_23 • / Pac23 • manasmangaonkar@gmail.com • pac23.github.io
  8. version control with git

  9. why git?

  10. Adeen Shukla | @adeen-s

  11. history: Know exactly which files changed, who made those changes,

    and when those changes occured. backup: Ability to have different versions of the code in different places. collaboration: Collaborate easily with other people on the same codebase
  12. workshop outline

  13. my first git: repositories, staging, committing git good: branching, jumping

    around, merging git world: enter in the repository world git ideas: cool stuff to do with git open sourcing: the idea that it’s a changing.
  14. $ terminal commands are typed with this font and color.

    before we begin...
  15. don’t worry! there is always a cheat sheet!

  16. my first git Create your shiny repo and your first

  17. what is a repository? A repository is like any other

    folder on your computer, it can contain any type of file and works in exactly the same way… Except: It has a hidden file named ".git" that stores the history of that folder
  18. first, install git

  19. second, start a new repository by $ git init <repository

  20. what are commits? snapshots of the state (i.e. code) of

    your repository
  21. commit your work by using $ git add . $

    git commit -m “<details>”
  22. more about commits Bc7fd9 “Add Oranges” a3ffde “Add apples” 9cd1ce

    “First commit, Add fruit.txt” Commits form a linked list structure which shows what you have done over time. Use git log to see your commit history.
  23. staging changes Unstaged Changes Staged Changes Committed Changes git add

    git commit git reset <hash> git reset .
  24. my first git: recap $ git init - converts a

    folder to a super smart git repository. $ git add - adds the files to the staging area. $ git commit - creates a snapshot of the repository. $ git reset - Undo your commit or unstage your files. $ git log - View your commit history. $ git status - See the current status of the repository
  25. git good branching, context switching, merging

  26. Bc7fd9 “Add oranges” a3ffde “Add apples” 9cd1ce “First commit, Add

    fruit.txt” commits
  27. working with branches $ git branch - see a list

    of all available branches. $ git branch <branchname> - create a new branch with the desired name, based on the current branch.
  28. Bc7fd9 “Add oranges” a3ffde “Add apples” 9cd1ce “First commit, Add

    fruit.txt” master commits branches
  29. working with HEAD $ git checkout <branch name> - Redirect

    HEAD to the desired branch
  30. Bc7fd9 “Add oranges” a3ffde “Add apples” 9cd1ce “First commit, Add

    fruit.txt” master commits branches HEAD HEAD somebranch
  31. merging = combining commits $ git merge <branch name> -

    creates a new commit that combines the last commit of the current HEAD branch with the last commit of the desired branch.
  32. git good: recap... $ git branch - List all existing

    branches $ git branch <name> - creates a new branch $ git checkout <name> - jump to the branch with this name $ git merge --no-ff <name> - merge the branch with this name into the current one.
  33. git world publishing, updating and downloading

  34. Let's take a look at

  35. downloading / updating Repos $ git clone <url> - downloads

    a copy of a remote git repository. $ git pull - download and merge new data from the remote $ git push - sends your version to the server.
  36. git ideas a quick look at what other folks are

    doing on
  37. programs and technology leadership at your school and much more...

  38. Host your personal page for free on

  39. #OpenSourcing Understand more about the movement that is changing the

    way you collaborate.
  40. Collections on open and explore the vast world of repositories

    that exist. I'm sure you'll be surprised! Social Impact Learn to Code Organizations Open Journalism and much more...
  41. and many others ... Communities on open and explore communities

    that do a change in the open source world. and much more...
  42. Events on open and participate in events that happens around

    the world in prol of the open source. and much more... 24 Pull Requests Hacktoberfest GitHub Field Day
  43. GitHub Education GitHub for Science GitHub for Government for X

    and much more...
  44. time to start the workshop!

  45. Doubts? Suggestions? Feedback? Your opinion is worth gold stickers!

  46. Let's take a picture? Share on social networks and check

    @[handle] #githubeducation #githubcampusexperts
  47. None
  48. Thank you! @adeen-s /in/adeen-s @adeen-s

  49. None