Intro to Git, GitHub, and BitBucket

Legal Services National Technology Assistance Project (LSNTAP)
14. Jun 2016
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
1 von 41

Más contenido relacionado

Was ist angesagt?

Intro to git and git hubIntro to git and git hub
Intro to git and git hubVenkat Malladi
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHubNicolás Tourné
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash CourseNilay Binjola
Learning gitLearning git
Learning gitSid Anand
GitGit
GitMayank Patel
Git and github 101Git and github 101
Git and github 101Senthilkumar Gopal

Destacado

Using Git and BitBucketUsing Git and BitBucket
Using Git and BitBucketMedhat Dawoud
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence Parag Gajbhiye
Bitbucket and gitBitbucket and git
Bitbucket and gitRyo Katsumata
Gitt and Git-flowGitt and Git-flow
Gitt and Git-flowMd. Masud
Intro To Version ControlIntro To Version Control
Intro To Version Controlceardach
Distributed Version Control (DVCS) With MercurialDistributed Version Control (DVCS) With Mercurial
Distributed Version Control (DVCS) With MercurialTed Naleid

Similar a Intro to Git, GitHub, and BitBucket

Git & GitLabGit & GitLab
Git & GitLabGaurav Wable
introductiontogitandgithub-120702044048-phpapp01.pdfintroductiontogitandgithub-120702044048-phpapp01.pdf
introductiontogitandgithub-120702044048-phpapp01.pdfBruceLee275640
Introduction to git and githubIntroduction to git and github
Introduction to git and githubAderemi Dadepo
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros DeveloperNyros Technologies
Introduction to git and GithubIntroduction to git and Github
Introduction to git and GithubWycliff1
Introduction to Git & GitHubIntroduction to Git & GitHub
Introduction to Git & GitHubWasit Shafi

Más de Legal Services National Technology Assistance Project (LSNTAP)

Language Access WebinarLanguage Access Webinar
Language Access WebinarLegal Services National Technology Assistance Project (LSNTAP)
Free and Low Cost Technology Tools for Legal AidFree and Low Cost Technology Tools for Legal Aid
Free and Low Cost Technology Tools for Legal AidLegal Services National Technology Assistance Project (LSNTAP)
50 Tech Tips50 Tech Tips
50 Tech TipsLegal Services National Technology Assistance Project (LSNTAP)
Sharelaw + Video TipsSharelaw + Video Tips
Sharelaw + Video TipsLegal Services National Technology Assistance Project (LSNTAP)
Intro to UXIntro to UX
Intro to UXLegal Services National Technology Assistance Project (LSNTAP)
Online Dispute ResolutionOnline Dispute Resolution
Online Dispute ResolutionLegal Services National Technology Assistance Project (LSNTAP)

Más de Legal Services National Technology Assistance Project (LSNTAP)(20)

Último

MapInfo Pro v2023: The Next Dimension in Spatial AnalyticsMapInfo Pro v2023: The Next Dimension in Spatial Analytics
MapInfo Pro v2023: The Next Dimension in Spatial AnalyticsPrecisely
TEKART CON 2023TEKART CON 2023
TEKART CON 2023AdedoyinSamuel1
Webinar: Discover the Power of SpiraTeam - A Jira Alternative To Revolutioniz...Webinar: Discover the Power of SpiraTeam - A Jira Alternative To Revolutioniz...
Webinar: Discover the Power of SpiraTeam - A Jira Alternative To Revolutioniz...Inflectra
TaketoFujikawa_KES2023TaketoFujikawa_KES2023
TaketoFujikawa_KES2023Matsushita Laboratory
Zodhya intro deck Japan ILSZodhya intro deck Japan ILS
Zodhya intro deck Japan ILSRohithPallerla
Value proposition of SSI tech providers - Self-Sovereign IdentityValue proposition of SSI tech providers - Self-Sovereign Identity
Value proposition of SSI tech providers - Self-Sovereign IdentitySSIMeetup

Intro to Git, GitHub, and BitBucket

Hinweis der Redaktion

  1. We are covering 5 things today: what Git is and why it matters, git setup and options for working with git. I’ll walk through the basic Git commands, and then do a demo of GitHub and Bitbucket’s cloud Git hosting. Finally, I’ll share some resources for next steps.
  2. So what is Git? It’s like document management for code. There is a master repository and then everyone who accesses that has their own local repository and a complete copy of the files. If I edit something in my working copy, I commit it to my local repository and when I’m ready to share it, I publish it to the master repository. If I screw up my working copy, I can erase what I’ve done and it hasn’t affected anything else. And if we push something bad ot the master, we can undo it.
  3. First, why should we use version control? There’s 2 reasons: one to make our own development projects better and second, to take advantage of everyone else’s stuff. For our own projects, Git brings order to chaos. It provides us with a history of the changes we’ve made and we can roll back. It organizes those changes in a structure we don’t really have to care about unless we need to roll back and it means if we have multiple people working on things, there isn’t a lot of stepping on toes or “wait, I’m not done using that file” kind of things. But beyond our own work, there’s a huge amount of open source projects, mostly on Github, that we can use, modify, and contribute back if we know just a little bit of git. Some examples just within our own community are qnamarkup, Connecticut’s classroom module, and the entire DLAW template are all hosted on Github.
  4. I know there are at least a few websites in the community that don’t have a single custom module and don’t write any of your own code, so why should you still be using Git? Because somebody is making changes to the code that runs your Drupal website. In Drupal, Git is useful in 3 places. The obvious use case is if you write your own code via custom modules But even if you are just using contributed modules, someone is changing that code periodically. By using git, every time you update, you can more easily revert a bad thing or if you need to apply a patch to a contributed module, you can commit those patches to git to help you remember to recommit them next time the module changes. And finally, configuration. Everytime you change a setting in your Drupal site, it changes somewhere. In Drupal 8, it lives in code. In Drupal 7, in the database. So out of the box, you can leverage git to rollback a bad configuration change. In Drupal 7, if you use the Features module to keep your configuration in code, you can do the same thing. So if all you do is break a view, if it is in code, you can undo it to the last known good state.
  5. To use Git, you have really 3 options: the command line, a client application like Github client or Atlassian’s SourceTree (both free) and most development IDEs, such as phpstorm, eclipse, netbeans, sublime text, include git tools or have plugins to add git tools. It’s largely a matter of preference and while I mostly use the command line, sometimes I do things directly in phpstorm as well. As I walk through the commands, I’ll demo in both the command line and a client.
  6. But to use git, you need to install it. I am not going to demo how to install git but this slide has the links for Mac, Windows, and Linux operating systems.
  7. Git works largely on adds, commits, and pushes. You work in the working directory that is local on your machine. When you add your files to git, it moves it to a staging area. When you commit, it updates your local repository and creates a record of your changes. If you push your changes to a remote repository, that commit gets recorded there as well. If you pull from a remote repository, your local repository gets updated.
  8. And now to walk through some basic steps. I’ve created a couple local folders on my desktop that I’m going to use. Let’s start with the command line demo. git remote add origin https://github.com/gadaniels/demo-command.git Tell Git who you are: git config --global user.name "Gwen Daniels" git config --global user.email gdaniels@illinoislegalaid.org
  9. So now you know the basic everyday git commands. One of the most powerful things in git is being able to have different branches. By default, everything is in the master branch. But if that’s what is on your website, you might want to test or develop in a different branch and then merge them together. Let’s walk through that.
  10. Besides branches, there are tags. Tags are essentially snapshots of a branch at a specific point in time. We use tags a lot at ILAO to mark sprint releases. Every 2 weeks set of code changes, gets tagged with a name and then pushed up to production. We don’t actually use the master branch directly. I can deploy a tag or roll back to a tag just like i would with branches or master
  11. And finally, one of the biggest powers of git is in the ability to undo your changes. You can undo local work using checkout or use revert to undo committed work.
  12. So that’s a basic overview of Git. So what are GitHub and Bitbucket? Well, they are hosted versions of Git. They are very similar. We’ve used GitHub for several years at ILAO but are thinking about Bitbucket because we use Jira, another Atlassian product, for our software development project management. Again, it’s a lot of personal preference.
  13. So let’s do a quick tour of Github.
  14. I can, from within my browser, create a new file and commit it. While this isn’t probably normal behavior, it can be useful in emergency situations.
  15. I can create an isuse, label it, tag it to a milestone, and or assign it to someone. If I assign it to someone, it notifies them via email.
  16. Github will automatically notify the creator of a comment when someone comments on an issue. I can just reply in my email and it will post.
  17. Git is free, github client, source tree are both free, both github and bitbucket will let you have at least a free public repository so the best next step if you want to do more with git is to try it. Another option is this try.github.io