Skip to content

EvanMisshula/residentSurvey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This week you learned git and that makes my life so much easier. I am going to ask fork this repo and add a few things to it and send me a pull request.

This is the README file for the repo. Everyone is going to create a fork of this repository and find the directory whose name is

firstName-lastName

where your last name is separated from your first with a dash "-". For example, my name is Evan Misshula. My directory would be:

evan-misshula

Once you have done this copy a picture of your face into the directory. You will also fill out the student survey in the directory with your name. Finally you will send me a pull request from your branch to add it to the repo.

Read on for details.

Fork this repo

The First thing you that is necessary to complete this is to fork the repository. That means that you create your own copy of the repository in your github account.

img

You don't edit anything on github. Github stores your backup. In order to edit your repo you have to copy it to your machine. This requires you to download the git program to your local machine. You will then need to install it. There are several ways to do this.

Mac and windows

Again this is for reference only

Mac

You just need to go this link:

http://git-scm.com/download/mac

Double click on the downloaded file and install in the usual way.

Windows

You just need to go this link:

http://git-scm.com/download/win

Double click on the downloaded file and install in the usual way.

Configure git on your local machine

Again this is for reference only

On your machine open a terminal

Mac

Left click on launchbad (the icon with the rocket on it). In the search bar type terminal. Left click the terminal and you are there.

Windows

  1. Windows 8 and 8.1

    Right click on the Start button. This opens the power user menu. There is a shortcut for the terminal on that. Left click on it and you are there. Here is a larger article on this:

    http://pcsupport.about.com/od/windows-8/a/command-prompt-windows-8.htm

  2. Windows 7

    Click on the Start button. In the search box, type the following:

    command

    Click on Command Prompt in the search results listing. Here is a larger reference.

    http://pcsupport.about.com/od/windows7/a/command-prompt-windows-7.htm

Command line tutorial

The command line is the primary way to interact with your operating system. We are only going to use a few commands but we have to use different commands depending whether you are running windows or mac. Mac and Linux systems have mostly the same commands since Mac OS X is built on top of Berkley Software Distribution Unix. Linux and Mac are sometimes called *nix systemes. Windows NT (the forerunner of Windows 7 and Windows 8) was built by the designers of Digital Equipment Corporation (DEC) Vax system.

Here are the commmands we will use:

\*nix windows puropse
pwd echo %cd% tell us what directory we are in
ls dir list the files in the directory we are in
cp copy copy files from one place to another
cd cd change directory
. . means here
.. .. up one directory

The filesystem

Mac OS X

Your documents are in:

/Users/<your name>/Documents

In the terminal type:

cd Documents

To check where you are type:

pwd

This returns the present working directory.

Windows

Your Documents are in C:\Users\\Documents. In the terminal type:

cd Documents

Set global git variables

We did not do this in class. It won't hurt to do this.

Tell Git your name so your commits will be properly labeled. Type everything after the $ here:

git config --global user.name "Your Name"

Tell Git the email address that will be associated with your Git commits. The email you specify should be the same one you used to sign up for GitHub.

git config --global user.email "YOUR EMAIL ADDRESS"

Clone this repository from your github account to your local machine

Now go back to your browser and open up the repo that you forked. On the right side of the page near the top, there is a box under settings. BE CAREFUL This is tricky. In that box is the URL of your fork. Here is a picture.

img

Make sure the protocol is set to ssh. This way you can use the key that you already set up. Now that you know what you are looking for. Copy it to the clipboard by left-clicking the button. You clone it by typing:

git clone git@github.com:<your_github_username>/residentSurvey.git

Now you have your own copy of the repo both on your machine and in your github account. If you want to work with the files in the residentSurveys directory, you should change into that directory. To do this you should type:

cd residentSurvey

In an text editor, you can look at any of the files. You can also list the files by typing either ls or dir depending on your operating system.

Master vs. branch

You actually have a copy of the master on your machine. When you add something for the first time, you should not add to the master you should make changes to your own branch. Usually the branch name is the topic. In this case use your first name. Type:

git branch <first_name>

We can see all of the branches by typing:

git branch

The star means that we are still on the master branch.

Switch branches

Now we are going to begin constructing the changes we want incorporated into the main project. In the last section we made a branch now we are going to start to change it. To switch to your branch, type:

git checkout <first_name>

Create a directory

If you listed the files in the residentSurveys directory, you should see that there is a directory called residents. Inside of that is a cohort directory. Your cohort is Sp2016. You should change directories into it by typing:

cd residents/Sp2016

Copy your picture into that directory

You can use the command line or a gui to copy your picture into the directory you just created.

Add your picture to your branch

Make sure your image file is called your firstName_lastName.jpg or firstName_lastName.png. For example, my photo would be evan_misshula.jpg.

Next add your picture to your branch. You will do this by adding your image file to your branch by typing:

git add firstName_lastName.jpg

Commit your local changes

You should save or commit your changes with a message. I opened an issue for each of you in github. Type the following:

git commit -m "added my picture. closes #<your-issue-number>"

To update your copy on github you have to push your changes which are in your firstName branch. Before I show you how to do that, let's make sure no one else has pushed changes that will cause a conflict with our changes.

See everyone's changes

Configure an upstream master

Git does not automatically know where you want to pull from. To see where git is pulling from, type:

git remote -v

The "-v" is a common command line flag for verbose. Because you forked both the (fetch) where you pull from and where you push to (push) are the same. Now specify a new upstream repository that will be synced by the fork.

git remote add upstream git://github.com/EvanMisshula/residentSurvey.git

Sync the fork

To see everyone's accepted changes to the master, you have to pull from the upstream master. This requires a fetch command. Make sure that you have commited your changes. Type:

git fetch upstream

You have now pulled the changes from my branch to your local machine and onto your firstName branch. The next step is to merge it into your firstName branch.

git merge upstream/firstName

Fill out the survey

The reason I want a picture of you and the reason why I want you to fill out the survey is because I want to get to know who you are. I also value your feedback and so does the whole Queens College, SBS and NYCDA team. Your comments are going to have an big impact on Computer Science at Queens College and across CUNY.

Open the survey

Git does much better with flat files than spreadsheets. I am including the survey as a CSV file but you should open it in excel to fill it out. Just save it as a CSV.

git add residentSurvey1.csv
git commit -m "added my survey"

You will want to save those to your github account as well. So to finish, type:

git push origin firstName

Pull request

If you refresh your github page you will see that the repository now has two braches. Switch to the firstName branch and send a pull request.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published