Verified Commit 6b3823c3 authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

second round of revisions

parent af28f383
......@@ -70,7 +70,7 @@ If the local branch does not exist but the remote does, it is created automatica
# Create your own version
# Create your own version (i)
Assume that you want to work on a file:
......@@ -87,12 +87,11 @@ The `-b` flag creates the branch. Locally, you have your own version now:
# Create your own version (ii)
Push your version to your fork:
```bash
$ git push origin myBranch
```
<div class="fragment">
<img src="slides/img/icon-live-demo.png" height="100px">
# How do I start working on a repository?
You have to `clone` it first:
```bash
$ git clone git@github.com:userName/myRepo.git myRepo
```
If you did not configure your SSH key, clone using HTTPS:
```bash
$ git clone https://github.com/userName/myRepo.git myRepo
```
You will be prompted to enter your credentials.
......@@ -35,11 +35,11 @@ $ git status
# Modify a file
Copy the file `template.md` in the folder `_attendees` and rename it with your firstname:
Copy the file `firstNameLastname.md` in the folder `_attendees` and rename it with your first and last names:
```bash
$ cd _attendees
$ cp template.md myName.md
$ cp firstNameLastname.md myName.md
```
Then, make your changes with your favorite editor!
......
# What is a `fork`?
<img src="slides/img/fork.jpg" class="as-is" height="500em"/>
<center><img src="slides/img/fork.jpg" class="as-is" height="500em"/></center>
<!--http://www.cndajin.com/data/wls/246/22302193.jpg-->
# Not really ...
<img src="slides/img/fork-crossed.png" class="as-is" height="500em"/>
<center><img src="slides/img/fork-crossed.png" class="as-is" height="500em"/></center>
# What is a `fork`?
In general, when contributing to a repository, you only have **read** access.
- In general, when contributing to a repository, you only have **read** access.
In other words, you can only **pull** (unless it is your own repository or access has been granted).
- In other words, you can only **pull** (unless it is your own repository or access has been granted).
In general, you **cannot write** changes. In other words, you do not have **push** access.
- In general, you **cannot write** changes. In other words, you do not have **push** access.
You have to work on your **own copy**.
- You have to work on your **own copy**.
In other words, you have to work on your own <font color="red">**fork**</font>.
- In other words, you have to work on your own <font color="red">**fork**</font>.
# How to get a fork?
<h2>How to get a fork?</h1>
Browse to the original repository and click on the button `Fork`:
![Fork the repo](https://help.github.com/assets/images/help/repository/fork_button.jpg)
<img src="slides/img/icon-live-demo.png" height="100px">
......@@ -42,8 +39,6 @@ https://github.com/LCSB-BioCore/basic-git-practice
Then, clone your fork to your home directory!
<img src="slides/img/icon-live-demo.png" height="100px">
```bash
$ git clone git@github.com:<yourName>/basic-git-practice.git
```
......@@ -53,6 +48,13 @@ Change to the practice directory with:
$ cd basic-git-practice
```
<img src="slides/img/icon-live-demo.png" height="100px">
If you did not configure your SSH key, clone using HTTPS:
```bash
$ git clone https://github.com/userName/basic-git-practice.git basic-git-practice
```
# A note on shortcuts ...
......
......@@ -14,5 +14,4 @@ Positive point: GitHub and GitLab are (almost) the same.
- **GitHub**: [https://github.com](https://github.com)
- Public GitLab: [https://gitlab.com](https://gitlab.com)
- LCSB specific: [https://git-r3lab.uni.lu](https://git-r3lab.uni.lu)
\ No newline at end of file
- **GitLab**: [https://gitlab.com](https://gitlab.com)
\ No newline at end of file
......@@ -2,9 +2,8 @@
{ "filename": "index.md" },
{ "filename": "overview.md" },
{ "filename": "what_is_git.md" },
{ "filename": "the_terminal.md" },
{ "filename": "github_gitlab.md" },
{ "filename": "cloneRepo.md" },
{ "filename": "the_terminal.md" },
{ "filename": "forks.md" },
{ "filename": "branches.md" },
{ "filename": "essential_commands.md" },
......
# Overview
1. The terminal
2. The editor
3. What is `git`? What is the use of `git`? <!--(5 min)//-->
4. Installation of `git`
5. GitHub and GitLab <!--(5min)//-->
6. How do I configure `git`? <!--(5min)//-->
7. Where and how to start? <!--(5min)//-->
8. What is a fork? <!--(5min)//-->
9. What are branches?
10. The 5 essential commands (`pull` / `status` / `add` / `commit` / `push`)
11. What are merge/pull requests? <!--(10 min)//-->
12. How do I synchronize my fork?
13. Best practices
\ No newline at end of file
1. What is `git`? What is the use of `git`?
2. GitHub and GitLab
3. The terminal
4. What is a fork?
5. What are branches?
6. The 5 essential commands (`pull` / `status` / `add` / `commit` / `push`)
7. What are merge/pull requests?
8. How do I synchronize my fork?
9. Best practices
# Synchronize your fork
# Synchronize your fork (i)
![bulb](slides/img/bulb.png) Remember, we have to regularly update our own copy of the code.
......@@ -25,6 +25,7 @@ $ git fetch upstream
# Synchronize your fork (ii)
Merge the retrieved changes on the `master` branch:
```bash
......
# Note on Microsoft Azure Devops
This course aims at the basics of using `git`.
In order to understand the concepts of `git`, the terminal will be used instead of any GUI.
The same terminology applies.
More info on Azure Devops & Git: https://docs.microsoft.com/en-us/azure/devops/repos/git/
# First steps in the terminal
Starting the terminal presents itself with a line where you can enter a command
......@@ -15,7 +26,7 @@ in your home directory (unless otherwise configured), denoted as `~/`.
# Essential Linux commands
# Essential Linux commands (i)
List the contents of a directory
```bash
......@@ -43,6 +54,8 @@ $ cd ../..
# Essential Linux commands (ii)
Move a file or a directory
```bash
$ mv myFile.m myNewDirectory/.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment