Like this? Share it with your network

Share

Git 101

on

  • 331 views

A basic intro to Git for 0xFreeFridays meetups at Technological Educational Institute of Piraeus

A basic intro to Git for 0xFreeFridays meetups at Technological Educational Institute of Piraeus

Statistics

Views

Total Views
331
Views on SlideShare
325
Embed Views
6

Actions

Likes
0
Downloads
3
Comments
0

2 Embeds 6

http://www.linkedin.com 4
https://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Git 101 Presentation Transcript

  • 1. Git 101 FreeFriday @ Teipir
  • 2. Real quick...
  • 3. Free Fridays Discuss about technology and stuff Learn new things and stay up-to-date Get better at what we do Enrich our education
  • 4. Dimitris Tsironis Front-end Engineer at BugSense, JavaScript lover || hater, Open-source & (Coffee)Script addict, Technology afficcionado
  • 5. Source Control Management Keep your code organized in repositories Enhance contributing Source versioning
  • 6. Git Distributed Version Control System (DVCS)
  • 7. Git Created by Linus Torvalds [2005] Written (mostly) in C and Shell
  • 8. Why distributed? Every developer gets a copy of the repo Make your contributions really fast Work offline
  • 9. Git installation sudo apt-get install git [Ubuntu] brew install git [OSX] http://bit.ly/14Gqzyp [Windows]
  • 10. Creating a repository $ mkdir -p ~/gitff/lecture1 $ cd ~/gitff/lecture1 $ git init
  • 11. Now your folder is a git repository
  • 12. Start coding! or whatever
  • 13. Write some code Create a text file (touch readme.txt) Add your name inside the file
  • 14. Cool story bro! but how can I update my repo?
  • 15. Commit A set of changes
  • 16. The staging area All the modified/added/deleted files that are going to be commited
  • 17. git status # On branch master # # Initial commit # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # readme.txt nothing added to commit but untracked files present (use "git add" to track)
  • 18. Add readme to stage git add readme.txt This command adds readme.txt (or changes in readme.txt) to staging area
  • 19. Alternative adding all files to stage git add --all This command adds (add) all (deleted/ created/modified) files to staging area
  • 20. git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: readme.txt #
  • 21. Commit changes git commit -m “Initial Commit” This command creates the commit containing the staged changes
  • 22. Now add your email to readme.txt
  • 23. How can I get my code to the web?
  • 24. Github (Hosted) Bitbucket (Hosted) GitLab (Private) And may others
  • 25. Github a web-based hosting service for software development projects that use Git Written in Ruby on Rails and Erlang Running since 2008
  • 26. Creating a new Github Repository
  • 27. The remote (origin) The git path to remote repository (usually called origin)
  • 28. Add remote to local repository git remote add origin your_remote This command adds a remote to a remote repository
  • 29. git remote -v Show my remotes
  • 30. Push pushing commits to remote repository
  • 31. Push changes to remote repository git push origin master We will only use master branch for the time being
  • 32. Pull pulling commits from remote repository
  • 33. Pull changes from remote repository git pull origin master We will only use master branch for the time being
  • 34. Clone Get a copy of a repository
  • 35. Cloning a repository $ cd $ git clone https://github.com/FreeFriday/ my_first_repo.git angels_first_repo $ cd angels_first_repo $ ls -l
  • 36. Thanks! @tsironakos