Skip to content

mark-de-haan/git-workshop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Table of contents

Git tutorial

Install on Windows

  1. Download git from here
  2. Go through the installer steps. It is recommended to look at every step, but if you do not understand a 100%, the default settings are OK
  3. You have installed git

NOTE: The following parts all use the commandline. Windows users are recommended to install a decent terminal. If you do not have one, the Git Bash terminal will work as well

How to get started with GitHub

Go to GitHub and create an account

Generating an SSH key

On your command line, type the following

git config --global user.email "email@example.com"
git config --global user.name "Mona Lisa"

ssh-keygen -t rsa -C "email@example.com"

cp ~/.ssh/id_rsa.pub > /dev/clipboard 

Now that you have copied your public SSH key to your keyboard, in GitHub go to Settings -> SSH and GPG keys and add your key with a nice label

Creating your first git repository

It is good practice to have your git repositories in one place. For the following paragraphs, our git folder will be in C:\Users\user\Documents\

Create a git folder for your repositories

Open up the terminal and enter the following commands

cd ~\Documents
mkdir git
cd git

Create a local repository

Go to the repository for this course and press the Fork button in the top right

This will fork the repository and create a local copy on your GitHub account. This copy can be edited, removed, destroyed, ruined I do not care. On that copy, Press clone or download and copy the URL you see.

Next, inside your git folder use the following command

git clone git@github.com:<your_name_here>/data-analytics-and-science.git

It will create a data-analytics-and-science folder for you

cd data-analytics-and-science
git status
git remote -v

Making your first change

Make a change, open a jupyter note book, do something cool.

# See the changes
git status

# Add changes to file tracker
git add .

# Add all changes to the tree
git commit -m "Add making your first change to README"

# Push changes to master on origin
git push origin master

Opening a pull request

Updating local repository and keeping your fork in sync

Resources

About

Reference material on how to use Git

Resources

License

Stars

Watchers

Forks

Packages

No packages published