Skip to content
Snippets Groups Projects
Commit 5a674528 authored by EduardoChamorro's avatar EduardoChamorro
Browse files

git tutorial added

parent 56852b48
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -4,6 +4,7 @@
### Week 1: Principles & Practices, Project Management
* [Git Simple Cheat Sheet](week01_principles_practices_project_management/git_simple.md)
* [Git Extended Cheat Sheet](week01_principles_practices_project_management/git_cheat_sheet.md)
* [Resources for learning HTML+CSS](week01_principles_practices_project_management/html_css.md)
* [Git vs. Mercurial](week01_principles_practices_project_management/git_mercurial.md)
......
# GIT SIMPLE CHEAT SHEET
## Fast guide to upload and update your repo to the GIT repo of Fab Academy
* * *
## SETUP GIT (to do only the first time)
1. Install Git
* GitBash for windows users [Gitbash](https://gitforwindows.org/)
* Open command line for MacOSX user(Git is usually preinstalled on Mac and Linux.) [command line](https://blog.teamtreehouse.com/introduction-to-the-mac-os-x-command-line)
2. Add your Git username and set your email
> **git config –-global user.name “YOUR_USERNAME”**
3. Configure you email address for uploading
> **git config -–global user.email “jSmith@mail.com”**
4. Check if you have an SSH KEY already
> **cat ~/.ssh/id_rsa.pub** (If you see a long string starting with ssh-rsa, you can skip the ssh-keygen step)
5. Generate your SSH key
> **ssh-keygen -t rsa -C "$your_email"**
6. Now let´s see your keygen
> **cat ~/.ssh/id_rsa.pub**
7. Copy your key
> Windows: **clip < ~/.ssh/id_rsa.pub**
> Mac:**pbcopy < ~/.ssh/id_rsa.pub**
> Linux **xclip -sel clip < ~/.ssh/id_rsa.pub**
8. Finally add the copied key to GIT on the web version
[Video on how to do it](https://www.youtube.com/watch?v=54mxyLo3Mqk)
## COPY YOUR ACADEMY PERSONAL REPO.
1. Navigate to the folder where you want to put or create your repo. If you don´t know how to follow this [guide](https://www.digitalcitizen.life/command-prompt-how-use-basic-commands)(We recommend to create it in the desktop so you don´t have to dive into million of folders each time)
2. Clone your student repository
> **git clone git@git.fabacademy.org:fabacademy2017/yourlabname/yourstudentnumber.git**
## UPLOAD YOUR REPO ONLINE.
1. Add the new files you added to git
> **git add index.html** to upload file by file
> **git add .** to upload all the files at once
2. To download the last copy from the repository
> **git pull** (for downloading the last copy of the repository)
3. To have a working copy of your repo
> **git merge** (to have a working copy)
4. Now name your update, so you know what you changed with this push.
> **git commit -m ‘change you did’**
5. Upload to the Repository
> **git push**
## Other commands used frecuently
> **git rm** (in case you need to remove a tracked file)
> **git mv** move or rename a file ,a directory or a symlinkgit
> **git status** to see what changed
## Terminal commands you will use to get to your archive folder
**dir** To view the contents of a directory, type "dir"
**ls** To view the files as a list
**cd** It is frequently useful to know in which directory you are currently working To move between directories, use the cd command with the name of a directory example go to desktop is "cd Desktop"
**mkdir** To create a new directory
**del** Subsequently, you might want to clean up useless files
*Capital letters matter here*
* * *
## PROBLEMS
* Run to the extended GIT CHEAT SHEET [TUTORIAL](git_cheat_sheet.md)
[MORE INFO](http://www.git-scm.com/book)
**Original tutorial by:**
* [Eduardo Chamorro](http://eduardochamorro.github.io/beansreels/index.html), Fab Lab Barcelona 01.2019
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment