Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions 40 .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Lint & Type checks

on: [push]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node_version: 14

- name: Install dependencies
run: |
yarn install

- name: Run Prettier and ESlint
run: |
yarn lint

types:
name: Types
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node_version: 14

- name: Install dependencies
run: |
yarn install

- name: Run Typescript checks
run: |
yarn tsc
2 changes: 1 addition & 1 deletion 2 README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# coderhood.dev

This project was bootstrapped with [`create-r3f-app`](https://github.com/RenaudROHLINGER/create-r3f-app)
This project was bootstrapped with [`create-r3f-app`](https://github.com/RenaudROHLINGER/create-r3f-app)
2 changes: 2 additions & 0 deletions 2 next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
8 changes: 2 additions & 6 deletions 8 next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
const withOffline = require('next-offline')

function esbuildLoader(config, options) {
const jsLoader = config.module.rules.find(
(rule) => rule.test && rule.test.test('.js')
)
const jsLoader = config.module.rules.find((rule) => rule.test && rule.test.test('.js'))
if (jsLoader && jsLoader.use) {
if (jsLoader.use.length > 0) {
jsLoader.use.forEach((e) => {
Expand Down Expand Up @@ -111,9 +109,7 @@ module.exports = plugins(
withOffline,
{
workboxOpts: {
swDest: process.env.NEXT_EXPORT
? 'service-worker.js'
: 'static/service-worker.js',
swDest: process.env.NEXT_EXPORT ? 'service-worker.js' : 'static/service-worker.js',
runtimeCaching: [
{
urlPattern: /^https?.*/,
Expand Down
7 changes: 6 additions & 1 deletion 7 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"private": false,
"scripts": {
"lint": "yarn prettier && yarn eslint",
"eslint": "eslint --fix 'src/**/*.{js,jsx}' --ext jsconfig.json",
"eslint": "eslint --max-warnings 20 'src/**/*.{js,jsx}' --ext jsconfig.json",
"eslint-fix": "eslint --fix 'src/**/*.{js,jsx}' --ext jsconfig.json",
"prettier": "prettier --list-different '**/*.{js,jsx,md}'",
"tsc": "tsc --noEmit",
"dev": "next dev",
"build": "next build",
"export": "EXPORT=true next build && EXPORT=true next export",
Expand Down Expand Up @@ -49,6 +51,8 @@
"devDependencies": {
"@babel/core": "^7.12.17",
"@next/bundle-analyzer": "^10.0.7",
"@types/node": "^16.3.3",
"@types/react": "^17.0.14",
"autoprefixer": "^10.2.6",
"babel-eslint": "^10.1.0",
"babel-plugin-glsl": "^1.0.0",
Expand All @@ -75,6 +79,7 @@
"prettier": "^2.2.1",
"raw-loader": "^4.0.2",
"tailwindcss": "^2.2.4",
"typescript": "^4.3.5",
"url-loader": "^4.1.1",
"webpack": "^5.36.2"
},
Expand Down
2 changes: 1 addition & 1 deletion 2 public/data/academy/2-git/1-git-init/readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 'Git init'
publishedAt: '2021-06-24'
author: 'Tomas'
summary: 'Vamos a ver cómo guardar el progreso de nuestros proyectos y las ventajas de los sistemas de control de versiones. Hay que aprender a usar la consola. Veremos cómo publicar y guardar nuestros proyectos en la nube para accederlos y descargarlos donde queramos, que otros puedan verlo.'
youtubeURL: 'https://www.youtube.com/watch?v=7_d_sx773gs'
youtubeURL: 'https://www.youtube.com/embed/7_d_sx773gs'
---

import { themes, Image } from 'mdx-deck'
Expand Down
2 changes: 1 addition & 1 deletion 2 public/data/academy/2-git/2-git-branch/readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 'Git branch'
publishedAt: '2021-06-27'
author: 'Tomas'
summary: ''
youtubeURL: ''
youtubeURL: 'https://www.youtube.com/embed/y23b5MA8KPc'
---

import { themes, Image } from 'mdx-deck'
Expand Down
257 changes: 257 additions & 0 deletions 257 public/data/academy/2-git/3-git-remote/readme.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
---
title: 'Git remote'
publishedAt: '2021-06-27'
author: 'Tomas'
summary: ''
youtubeURL: 'https://www.youtube.com/embed/tchGAii8OC4'
---

import { themes, Image } from 'mdx-deck'


# Clase 3: `git remote`

### Tabla de contenidos

1. Repositorios remotos

1. Git fetch

1. Git push

1. Git pull

1. Pull request (PR)

---

## Repositorios remotos

Hasta ahora todo lo que hicimos con git fue hacer cambios en nuestro repositorio local. El repositorio en nuestra computadora.

Vimos un breve pantallazo de repositorios remotos al final de la primera clase, para poder subir nuestros cambios a GitHub.

Los repositorios en GitHub son repositorios remotos!

Entonces:

> ##### Los repositorios remotos son repositorios en un server y accedemos a su información usando git.

---



### Clonar un repositorio remoto

Cuando usamos `git clone <repo_url>` para clonar un repo, `repo_url` es la URL del repositorio remoto.

En este caso git agrega automáticamente un *remote* llamado `origin` con esta URL.

Esto es para que nuestro repositorio local recién clonado quede vinculado con el repositorio remoto original.

---


### git remote

Para ver los _remotos_ que tenemos configurados hay que ejecutar `git remote`:
```
$ git remote
origin
```

O `git remote -v` para ver las URL donde está el _remote_:
```
$ git remote -v
origin git@github.com:tomasdisk/mi-repo.git (fetch)
origin git@github.com:tomasdisk/mi-repo.git (push)
```

* **fetch** es buscar, es la url donde git busca y lee info del _remote_
* **push** empujar o publicar, es la url a donde git envia info desde nuestro repo local

---


### Agregar un remote

Lo hicimos en la primera clase!

Se hace con `git remote add <nombre> <url>`.

Por ejemplo:
```
$ git remote add origin_copia git@github.com:tomasdisk/mi-repo.git
$ git remote
origin
origin_copia
```

Ahora tenemos dos repositorios remotos (aunque los dos tengan la misma URL).

---


## Git fetch

Se usa para traer información de un _remote_.

```
git fetch <nombre>
```

Si queremos traer toda la información que tiene de `origin` que aún no tenemos en el repositorio local, hacemos:
```
$ git fetch origin
```

Cómo origin es _remote_ por defecto, no es necesario aclararlo y podemos hacer solo `git fetch`.

Esto trae todos los cambios(_commits_) del _remote_ pero no los combina(_mergea_) con nuestros cambios.

---


### ¿Dónde están esos cambios?

Si hacemos `git branch` vamos a ver la ramas que tenemos:
```
$ git branch
hotfix
* main
```

Pero si le agregamos `--all`, vamos a ver esto:
```
$ git branch --all
hotfix
* main
remotes/origin/main
remotes/origin/testing
```

Nos esta mostrando nuestras ramas locales, pero también las ramas que conocemos del _remote_.

---


## Git push

Cuando queremos compartir o publicar nuestros cambios, tenemos que enviarlos al servidor usando `git push <nombre_remoto> <nombre_rama>`.

Para enviar la rama `master` al servidor `origin`, entonces ejecutamos:
```
$ git push origin master
```

Esto enviara todos los commits hechos en `master` al servidor.

---

## Git pull

`git pull <nombre_remoto> <nombre_rama_remota>`.

Se usa para descargar lo cambios de una rama del _remote_ y mergearlos en la rama local en un solo paso.

Por ejemplo:
```
$ git pull origin master
```

En este caso estamos trayendo los cambios de la rama `origin/master` y haciendo el merge en la rama en la que estemos actualmente.

Esto va a ser posible si no surgen conflictos en el _merge_ entre la rama remota y la local.

---


### Tracking o seguimiento de ramas

Son ramas locales que tienen una relación directa con alguna rama remota.

Esto facilita el uso de las ramas cuando queremos publicar y traernos cambios.

Si hacemos `git remote show <nombre_remoto>`, git nos da bastantes detalles del _remote_:
```
$ git remote show origin
* remote origin
Fetch URL: git@github.com:tomasdisk/mi-repo.git
Push URL: git@github.com:tomasdisk/mi-repo.git
HEAD branch: main
Remote branches:
main tracked
testing tracked
Local branch configured for 'git pull':
main merges with remote main
Local ref configured for 'git push':
main pushes to main (local out of date)
```

Las últimas líneas dicen que `main` esta configurada para "seguir" a `origin/main`.

Si nuestra rama está configurada para hacer seguimiento a una rama remota, al hacer `git push` o `git pull` sin especificar ningun _remote_ o _rama_,
nos va a enviar (push) o descargar (pull) los cambios de la rama que se este "siguiendo".

---


### Renombrar o eliminar remotos

Renombrar `git remote rename <nombre> <nuevo_nombre>`:
```
$ git remote
origin
pb
$ git remote rename pb paul
$ git remote
origin
paul
```

Eliminar `git remote rm <nombre>`
```
$ git remote rm paul
$ git remote
origin
```

---


## Pull request (PR)

Es una herramienta de GitHub para solicitar, revisar y mergear ramas del _remote_ de forma online.

---


### Ejercicios

#### 1. Publicar cambios en una rama que no sea `master` o `main`

- Crear una rama, hacer un commit con cambios
- Publicar la rama con `git push`

#### 2. Crear el primer PR

- Publicar una rama en GitHub y crear un PR
- Mergear el PR 😄

---

### Resumen

Todos los comandos usados en la clase ✨

---


### Bibliografía

### 1. [Pro Git, Capitulo 2.5: Fundamentos de Git - Trabajar con Remotos](https://git-scm.com/book/es/v2/Fundamentos-de-Git-Trabajar-con-Remotos)
### 1. [Pro Git, Capitulo 3.5: Ramificaciones en Git - Ramas Remotas](https://git-scm.com/book/es/v2/Ramificaciones-en-Git-Ramas-Remotas)

<br />
<br />
<br />
1 change: 0 additions & 1 deletion 1 public/data/academy/2-git/readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ summary: 'Módulo de git, donde aprenderemos a usar git en la terminal para vers
Cuando una tarea está lista, su rama se puede fusionar con otra para juntar los cambios!


## Próximamente, jueves 8 de Julio
## 2. `git remote`

### ¿Cómo trabajar con un repositorio remoto?
Expand Down
Binary file added BIN +184 KB public/images/team/Lucas.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BIN +143 KB public/images/team/Meison.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BIN +31.9 KB public/images/team/Pablo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BIN +1.15 MB public/images/team/Tomas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.