Part 1 – Getting Going - Computer Science Programs



CSC 175Intro to Git and GitHubPart 1 – Getting Going Before you can do much with Git and GitHub, you need to be sure you have the proper things installed. Make sure you have GitHub for Desktop installed on your computer (PC or Mac). You can find it at . You will also need a GitHub account – make sure you sign up for one (it’s free) and give your GitHub username to your instructor so they can get you added to all the repositories associated with the class.GitHub for Desktop is essentially a piece of software that wraps the Git command line application. Everything you do in GitHub for Desktop just interacts with a Git repository on your computer, so as you work through the steps below just remember – all of this can be done from any tool that works with Git. Start by opening up GitHub for Desktop. It should be pretty much empty. When you first open it, you will need to give the application your GitHub account credentials. This is so that it can figure out what organizations and repositories you have access to in GitHub. To do this, go to the gear icon in the upper-right, and click “Options”On the “options” page, click “Add Account”. After you are on the “Log in” page, enter your GitHub credentials and click “Log in”After you’ve logged in, you’ll be taken back to the beginning screen. The next task we want to accomplish is “cloning” a repository from GitHub’s cloud-based website down on to our local computer. A repository is nothing more than a file folder with a hidden “.git” folder inside of it. That hidden “.git” folder keeps track of the changes to all of our files. The first step in cloning a repository is clicking the “+” sign in the upper-left corner. Make sure you click the “Clone” option on the pop-up window. When you’ve done that, you’ll see a list of GitHub accounts and Organizations on the left-hand side that you belong to, and on the right-hand side you’ll see the repositories that you have access toSelect the repository that you need to clone, and Click the “Clone REPOSITORY-NAME” button at the bottom. When you click this button, a window will pop up allowing you to select where the repository should be cloned on your computer. Consider the following tips when you select where to clone your repository: When Git clones a repository, it creates a folder named after the repository and places the repository contents inside of that. If you have a repository named “test-repo” that you are cloning, and you place it in “C:\temp”, Git will place the repository contents into “C:\git\test-repo\”. Do NOT clone to thumb drives or network drives. It will not go well.DO choose a folder on your computer that you can easily find. Good suggestions might be the DESKTOP, MY DOCUMENTS, or another area you are well versed with.Do NOT clone into a Dropbox or OneDrive folder. Again, it will not go well.Allow the repository to download and finish cloning itself to your local machine. If for some reason it fails, delete the cloned folder and just try cloning again. After the repository has finished downloading and cloning, open the repository folder. You can do this a number of ways by either just finding the new folder in Windows Explorer, or you can right click on the repository in GitHub for Desktop and then click “Open in Explorer”.Inside the folder should be a README.md file. Open that file with either Notepad, Code, or your favorite text editor and place your name somewhere in the file. Save the changes.When you go back to GitHub for Desktop, you should now see a new bar across the top indicating that a file has changed in your local Git repository. Click on the text that says “1 uncommitted change” and you will be taken to a screen that allows you to review the changes that have occurred in your Git repository. Once you’ve reviewed your changes, you need to Commit the changes to the repository. This act “seals” the changes into the history of the repository in case you want to go back and look at what has changed over time inside the folder. To make a Commit, you need to enter a message and then click the Commit button. After you click the Commit button and seal the commit into your repository’s history, the application’s screen will change back to showing “No Local Changes”. This is true that you have no “uncommitted” changes locally on your computer, but now we need to get our changes pushed to GitHub’s cloud servers so that it is safe and secure in case something happens to our computer. In order to do that click the Sync button in the top right.Wait while the synchronization process completes. Git is actually pushing all of your local changes to the GitHub copy of your repository, and at the same time it is also pulling down any changes that other people (collaborators) might have made to your repository. Sometimes this can take a few minutes.When it is done, log in to the GitHub website (where you created your account before) and double check that the changes from your local computer were properly pushed up to the GitHub copy of your repository. The final steps, submitting a URL to Bootstrap project 5 If you’ve gotten to this point successfully, then you’re good. The next step is to add a new Github Pages repository and add your Bootstrapped version of project five to your that repository then sync it up to the cloud. Remember, with Github, you can make as many repositories as you wish, but only one can be used as a website, that’s called “Github pages”. After that, send me the proper URL for the Github pages repository you create. Remember the Github Pages repository will have a special name, it needs to be your “username.github.io”. Please, follow the steps for creating that special repository since it will be used for the rest of the semester. I cover this in my video overview for the Github project on the course schedule. I think you are going to love using Github and I hope you find it as useful as I do. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download