GitHub Cloning: Explained. Leave a thumbs up and sub if you're new to support the channel. Script and links below. Thanks for watching!
Links:
GitHub Desktop: https://desktop.github.com/
Git: https://git-scm.com/downloads
Script:
Hey, how's it going everyone it's B00G and in less than 5 minutes,
we will be learning 2 ways to clone a repository on GitHub
The first method is using GitHub Desktop and the other is using Git Bash. Both options are simple and viable.
GitHub Desktop is more beginner friendly and Git Bash is the experienced and quick version. With that being said lets get right into it!
`Quick intro`
Alright so the first method we will go over for cloning repositories is GitHub Desktop. Go ahead and
Google GitHub Desktop or click the link in the description to go to their website.
If you're working on a Mac, click 'Download for macOS'. If you're working on Windows,
click the purple 'Download for Windows' button. Once it finishes downloading it will open up.
From here you can clone, create or add existing repositories. We are going to clone so click
the second button. Click URL on the top right. Go to the repository you want to clone, in this
case I googled a simple Hello World React Native program. Make sure to check near the top left
to see if you are on the master version or a branch. In my job, we have the master version, which
is the official source code, then there is a branch off of that called develop. The develop branch is
what the feature branches get merged into once the Pull Requests are reviewed by the managers.
So feature gets merged into develop which then gets merged into master or also referred to as main.
Once you verified you're on the correct branch, click the green Code button near the top right and
copy the link.
Go back to GitHub Desktop and paste the link in the top field. The second field is where the project will
be cloned to in your local machine. Edit this path if you want it to be saved somewhere else. Go ahead
and click the clone button. Once it finishes cloning, you can see what the current repository is, what the
current branch is, and when the last Fetch was. The last fetch means when you last cloned the repo. From here,
you can Open the repo page on GitHub in your browser, View the files of your repository in the file explorer,
and open the repo in your external editor of choice. Mine is VS Code but most IDEs will work. Once it opens,
the cloned repo and source code should be there. Open up the folders and click on the files to see their
contents.
The second method requires you to download and install Git. Google Git or click the link in the description
and select macOS if you're using a mac, otherwise click Windows. Follow the default installation. Open it
and type git --version to verify that it was downloaded and installed correctly. Make sure that you are on the
correct branch and then click the green code button near the top right and copy the link. Once it is copied,
open the file explorer and go to the location you want to clone the source code to. Right click on the empty
space in the folder and select 'Git Bash Here'. type in the command prompt: git clone and then paste the URL
that was just copied. Mine was placing a character at the beginning and end so just delete these two and
hit enter. The repo should be copied onto your local machine now. Verify that it is there by going back into
the folder and looking for the newly created folder inside of it. Open it and you will see the newly cloned repo.
Now you can open it by going to your IDE and selecting open folder. Search for it and then click 'Select Folder'
This will open up the project and you can see the source code once you open the folders and click on the files.
Alright guys hopefully you now have the same source code that is on the GitHub repo on your local machine. If this
video helped you, make sure to leave a thumbs up and if you're new to the channel consider subscribing. Feel
free to leave suggestions for future videos, and I'll see you... in the matrix!