Cloning from Github

Bibhash Roy
A free video tutorial from Bibhash Roy
Developer, Architect, Spring, Devops Trainer & Entrepreneur
4.4 instructor rating • 3 courses • 23,190 students

Lecture description

Learn more from the full course

Git & GitHub with Eclipse, Android studio & IntelliJ

Git and Github Bootcamp & Integration with popular development tools - Eclipse, Android studio & IntelliJ

07:55:43 of on-demand video • Updated October 2019

  • Understand what Git is, and how to use it.
  • Save your software projects in Git
  • Be able to clone Git projects from the Internet
  • Upload projects to Git enabled web repositories like GitHub
  • Access Git inside popular IDE's such as Eclipse, IntelliJ and Android Studio
English in this video we're going to go ahead and clone a project or a repository in this video we're going to go ahead from github into eclipse i'm and clone a project or a repository just going to minimize this existing from github into eclipse i'm repository that we've created and just going to minimize this existing swing over to git hub and going to repository that we've created and search for a project so going to look swing over to git hub and going to for repository Java tutorial just search for a project so going to look something related to java doesn't really for repository Java tutorial just matter what it is we're going to this something related to java doesn't really first one this had 977 forks that's quite matter what it is we're going to this popular first one this had 977 forks that's quite alright so let's just try cloning this popular project first or this repository alright so let's just try cloning this so the way to clone it come over here click project first or this repository on this button that gives us the URL so the way to clone it come over here click which we needed a click on here to copy on this button that gives us the URL to the clipboard then we swing back to which we needed a click on here to copy eclipse to the clipboard then we swing back to and in the git repositories down eclipse here we come up to the second option up and in the git repositories down here clone git repository and add the here we come up to the second option up clone to this view click on that button here clone git repository and add the and that is how the uri the host clone to this view click on that button repository path as well as the username and that is how the uri the host the password are all being populated for repository path as well as the username us which is good now the password are all being populated for username and password will only be us which is good now populated if you chose the option to username and password will only be store and secure store if not you'll need populated if you chose the option to to enter that each time click on next store and secure store if not you'll need you can see it was getting the remote to enter that each time click on next information we need to choose which you can see it was getting the remote branch so is their is only one here i'm going to information we need to choose which click on master click on next now we branch so is their is only one here i'm going to need to specify the location and click on master click on next now we actually this is something i probably need to specify the location and should have done earlier notice that actually this is something i probably this default this was the default when should have done earlier notice that we installed git within eclipse when we this default this was the default when set up the git repository that's we installed git within eclipse when we the default location for git projects set up the git repository that's on this computer didn't change that so the default location for git projects what I should really do is change that so on this computer didn't change that so it's going to the same place as our other what I should really do is change that so code so I will actually cancel out of this it's going to the same place as our other and the directory want if you remember was code so I will actually cancel out of this users tim work space and the directory want if you remember was let's go ahead and change that and on users tim work space windows click on the windows menu and let's go ahead and change that and on select Preferences on a Mac if you windows click on the windows menu and select the file menu and select select Preferences on a Mac if you Preferences want to come down here select the file menu and select to team git you want to change that Preferences want to come down here folder i'm going to change that to team git you want to change that to my standard workspace folder i'm going to change that which is this work space folder basically the to my standard workspace same one that we put in the sort of which is this work space folder basically the collections project in the previous same one that we put in the sort of video that's going to be my default and collections project in the previous probably should've done this earlier video that's going to be my default and ok so let's try this again so come back probably should've done this earlier to the git repository window going to ok so let's try this again so come back click on this little clone git to the git repository window going to repository and add the clone to this view click on this little clone git that's all correct the defaults they're repository and add the clone to this view all selected for us click on next click that's all correct the defaults they're on the master which is the one that we all selected for us click on next click want to work with that was selected so on the master which is the one that we probably didn't need to do anything their want to work with that was selected so but in any event now we got the right probably didn't need to do anything their default this time for the directory so but in any event now we got the right that's correct and if this was an default this time for the directory so eclipse project you can click on import that's correct and if this was an all existing eclipse projects after eclipse project you can click on import clone finishes but this is probably not all existing eclipse projects after an eclipse project will put that clone finishes but this is probably not click that option anyway we click on finish the an eclipse project will put that most likely it won't produce a project click that option anyway we click on finish the up here for us but it will add most likely it won't produce a project on to the git repository so you can see that up here for us but it will add was added but in terms of projects on to the git repository so you can see that in our navigator view or our package was added but in terms of projects Explorer view we still haven't got one in our navigator view or our package added and the reason for that is Explorer view we still haven't got one that this code even though it's a proper added and the reason for that is its now a repository wasn't an eclipse that this code even though it's a proper project so what we need to do is create its now a repository wasn't an eclipse an eclipse project from so the easiest things project so what we need to do is create to do here is to right-click on the new an eclipse project from so the easiest things git repository that was just added to do here is to right-click on the new select this copy path to clipboard and git repository that was just added the reason is we're going to be using select this copy path to clipboard and that to up here going to the reason is we're going to be using right-click within the package Explorer that to up here going to click on new select Java project which right-click within the package Explorer is what this type is the actual name I'm click on new select Java project which going to paste that link in there for is what this type is the actual name I'm reasons that will become apparent short going to paste that link in there for and we will delete everything reasons that will become apparent short before or sorry after the project name and we will delete everything and everything before so we're left with before or sorry after the project name just the project name which should and everything before so we're left with relate to the exact name that here just the project name which should java 8 - tutorial because the reason relate to the exact name that here is i just add another character show you java 8 - tutorial because the reason this is going to do some is going to is i just add another character show you create a folder unless we get the this is going to do some is going to project name identical to what is the create a folder unless we get the git repository name but by actually project name identical to what is the specifying the exact project name so see git repository name but by actually down here it says the wizard will specifying the exact project name so see automatically configure the JRE and down here it says the wizard will the project layout based on the exist automatically configure the JRE and a source in other words we're basically the project layout based on the exist creating a project around the existing a source in other words we're basically cloned git repository which is exactly creating a project around the existing what we want to do here click on next cloned git repository which is exactly and you got some option to override what we want to do here click on next things like the order and export adding and you got some option to override libraries if there's any other projects things like the order and export adding that need to be added to make this libraries if there's any other projects project compile any other source code that need to be added to make this but i'm not going to change anything project compile any other source code I'm gonna use all the defaults from this but i'm not going to change anything project and click on finish we have a I'm gonna use all the defaults from this look in here we should be able to see project and click on finish we have a that has been added that we've got some look in here we should be able to see errors at the moment but to look at that has been added that we've got some those in a minute but the main thing is errors at the moment but to look at we can see that these have all been those in a minute but the main thing is added they are now part of git now we can see we can see that these have all been the little icon indicating added they are now part of git now we can see that they are actually part of git ok so what the little icon indicating I need to do here is the right click on that they are actually part of git ok so what the project click on properties and you I need to do here is the right click on do this if your getting some errors we want to the project click on properties and you check out compliance level so you know do this if your getting some errors we want to actually it was in their java compliance want to check out compliance level so you know make sure actually what will do so click on actually it was in their java compliance want to enable project specific settings and make sure actually what will do so click on make sure our compiler compliance level enable project specific settings and is 1.8 most likely that's going to be make sure our compiler compliance level the problem is 1.8 most likely that's going to be let's fix some of these errors and the problem hopefully will fix all these errors and let's fix some of these errors and project and will clean it and select hopefully will fix all these errors and clean project and select the java 8 project and will clean it and select click okay that's fixed all those clean project and select the java 8 errors so that was just to do with a click okay that's fixed all those build setting we had the wrong errors so that was just to do with a compliance level and it was telling us build setting we had the wrong that there were some errors because they compliance level and it was telling us had the wrong and jdk compliance level that there were some errors because they alright so this point we've cloned that had the wrong and jdk compliance level repository this is someone else's public alright so this point we've cloned that repository so we won't be able to make repository this is someone else's public any changes to this unless they happen repository so we won't be able to make to give us write access so what I'm going to any changes to this unless they happen do is now that i've shown you how to to give us write access so what I'm going to just import a public repository is a do is now that i've shown you how to very useful if you just want to see how just import a public repository is a some code works or you know perhaps just very useful if you just want to see how run the program that you actually want some code works or you know perhaps just to start making changes to a repository run the program that you actually want to code that has been the cloned then i to start making changes to a repository will show you how to do that as well as to code that has been the cloned then i so just going go back to will show you how to do that as well as this project the Java 8 tutorial and I'm so just going go back to going to fork at this time click on fork so this project the Java 8 tutorial and I'm that's copy that into our own going to fork at this time click on fork so github account you can see now that that's copy that into our own has been forked and what I'm going to do github account you can see now that that for simplicity i'm going to change has been forked and what I'm going to do the name so it's different to the name that for simplicity i'm going to change that's already used in eclipse because the name so it's different to the name of course we've got that's already used in eclipse because this the original project from winter be of course we've got cloned as well so click on settings this the original project from winter be and we're changes to the simplicity of cloned as well so click on settings going to call it... and we're changes to the simplicity of ...now I've done that I'm gonna come over going to call it... here to clone or download i'm going to ...now I've done that I'm gonna come over copy it here to clone or download i'm going to let's go back to eclipse and will copy it clone this one as well so we want to let's go back to eclipse and will click on the option here to clone again clone this one as well so we want to noting that the new uri should be fork click on the option here to clone again java 8 this time noting that the new uri should be fork that's all correct going to click on java 8 this time next and pretty much everything will be that's all correct going to click on the same other than the name and it's next and pretty much everything will be going into the right folder there the same other than the name and it's the fork Java 8 tutorial might take the going into the right folder there opportunity to copy this directory good the fork Java 8 tutorial might take the place to do it because will be opportunity to copy this directory good pasting that in when we create the place to do it because will be project click finish giving a minute pasting that in when we create the to clone then we need to do that other project click finish giving a minute step that we did to clone then we need to do that other previously for the Java 8 tutorial right step that we did click in the package Explorer new previously for the Java 8 tutorial right java project going to paste in that name click in the package Explorer new i copied these are all get dimmed out java project going to paste in that name get disabled which tells us that we've got i copied these are all get dimmed out that correct and the message that the get disabled which tells us that we've got wizard is going to automatically that correct and the message that the configure the JRE and the project wizard is going to automatically layout based on the existing source is configure the JRE and the project correct and click on next and again we layout based on the existing source is are add anything that was appropriate here we correct and click on next and again we don't really need to do anything so i are add anything that was appropriate here we click on finish will probably get those don't really need to do anything so i same errors you can see we have got click on finish will probably get those those errors i'm just going to right same errors you can see we have got click click on properties java those errors i'm just going to right compiler click on enable project click click on properties java specific settings and make sure the compiler click on enable project compiler compliance level is specific settings and make sure the set to 1.8 click ok then we may need to do a compiler compliance level is project clean this time specifying just set to 1.8 click ok then we may need to do a default the fork java 8 tutorial to fix those project clean this time specifying just errors up and those error have now default the fork java 8 tutorial to fix those disappeared errors up and those error have now ok so we've now got a forked version of the disappeared project that has been cloned from git hub ok so we've now got a forked version of the and obviously that's in our local project that has been cloned from git hub repository as well and we are now able to and obviously that's in our local make some changes to that and that's repository as well and we are now able to because it now in our git hub make some changes to that and that's account so just go and choose any because it now in our git hub particular file this one account so just go and choose any will do will put a test in there save the file particular file this one same deal here with the git icon will do will put a test in there save the file showing and come out here to staging same deal here with the git icon if you want to see what's been changed and showing and come out here to staging org eclipse ADT call references if you want to see what's been changed and we're going to actually ignore that and org eclipse ADT call references some other changes in there we can we're going to actually ignore that and actually decide what we're going to do some other changes in there we can with them and we can be doing that actually decide what we're going to do either here somewhere in the Pro package with them and we can be doing that Explorer or the unstage changes let's either here somewhere in the Pro package just add that to the index you want to Explorer or the unstage changes let's add the classpath I think we decided just add that to the index you want to last time we weren't going to add the add the classpath I think we decided project so I'll ignore that and lets also last time we weren't going to add the add these changes add to index which i project so I'll ignore that and lets also think might have 2 git ignore files add these changes add to index which i there but for the purposes of think might have 2 git ignore files what we're doing that's fine anyway and there but for the purposes of we'll do a.... what we're doing that's fine anyway and .... we'll do a.... alright so let's commit and push which .... is going to make the alright so let's commit and push which changes to our local repository as well is going to make the as pushing it to git hub commit and push changes to our local repository as well confirmation that it has now been pushed as pushing it to git hub commit and push click on OK and come back here to git confirmation that it has now been pushed hub click on OK and come back here to git noting at the moment because this wasn't hub fork project 140 commits in the past noting at the moment because this wasn't refresh we should find that we get one fork project 140 commits in the past more now for the one that we've changed refresh we should find that we get one make it and 141 and we now got commented more now for the one that we've changed or comment change and configuration make it and 141 and we now got commented files tim buchalka 24 seconds ago or comment change and configuration click into that this is what was files tim buchalka 24 seconds ago actually changed you can see the click into that this is what was classpath was added because that's we actually changed you can see the created a eclipse project and classpath was added because that's we consequently that file was added theirs our test created a eclipse project and comment consequently that file was added theirs our test we've got 2 git ignores theirs one in the comment dot settings file for some reason and we've got 2 git ignores theirs one in the one at a high level but in the event dot settings file for some reason and you can see what happened to those they one at a high level but in the event were in the dot settings was actually you can see what happened to those they created by the looks of it whereas the were in the dot settings was actually . git ignore was updated with that created by the looks of it whereas the project that we said not to include . git ignore was updated with that so that's cloning from github into project that we said not to include eclipse that's a fairly straightforward so that's cloning from github into process so once you figure out eclipse that's a fairly straightforward that you may need to create a new process so once you figure out project after doing the git import that you may need to create a new alright so moving on in the next video project after doing the git import we're going to start talking about alright so moving on in the next video pulling changes from github into our we're going to start talking about local repository so see you in the next pulling changes from github into our video local repository so see you in the next