Update updating your fork sections
This commit is contained in:
@@ -1 +1,60 @@
|
|||||||
# Keeping your fork updated
|
# Keeping your fork updated
|
||||||
|
|
||||||
|
## Configuring your git remotes
|
||||||
|
|
||||||
|
If you created your fork correctly and cloned it locally, running:
|
||||||
|
```bash
|
||||||
|
git remote -v
|
||||||
|
```
|
||||||
|
|
||||||
|
it should output something alike:
|
||||||
|
|
||||||
|
> origin git@github.com:your_user_name/consul.git (fetch)<br/>
|
||||||
|
> origin git@github.com:your_user_name/consul.git (push)
|
||||||
|
|
||||||
|
Now we have to add consul github remote with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git add remote consul git@github.com:consul/consul.git
|
||||||
|
```
|
||||||
|
|
||||||
|
and to check everything is fine with
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git remote -v
|
||||||
|
```
|
||||||
|
|
||||||
|
again you should get:
|
||||||
|
|
||||||
|
> consul git@github.com:consul/consul.git (fetch)<br/>
|
||||||
|
> consul git@github.com:consul/consul.git (push)<br/>
|
||||||
|
> origin git@github.com:your_user_name/consul.git (fetch)<br/>
|
||||||
|
> origin git@github.com:your_user_name/consul.git (push)
|
||||||
|
|
||||||
|
## Pulling changes from consul
|
||||||
|
|
||||||
|
We start by creating a branch **consul_pull** from **master** branch to apply consul changes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout master
|
||||||
|
git checkout -b consul_pull
|
||||||
|
```
|
||||||
|
|
||||||
|
Then we fetch changes from **consul** remote server and it's master branch on to our feature branch:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git fetch consul
|
||||||
|
git merge consul/master
|
||||||
|
```
|
||||||
|
|
||||||
|
Now there are three possible outcomes:
|
||||||
|
|
||||||
|
1. You get a nice `Already up-to-date.` response. That means your fork is up to date with consul 😊👌
|
||||||
|
|
||||||
|
2. You get a screen on your git configured editor showing the commit message `Merge remote-tracking branch 'consul/master' into consul_pull`. That means git was able to grab latest changes from consul's master branch, and it can merge them without code change conflicts. Finish the commit.
|
||||||
|
|
||||||
|
3. You get some git errors along with a `Automatic merge failed; fix conflicts and then commit the result.` message. That means there are conflicts between the code changes you did and the ones done on consul repository since the last time you update it. That's the main reason we strongly recommend often updates of your fork (think at least monthly). Resolve merge conflicts carefully and commit them.
|
||||||
|
|
||||||
|
Now you can just simply push **consul_pull** branch to github and create a Pull Request so you can easily check all changes going into your repo, and see your tests suite runs.
|
||||||
|
|
||||||
|
Remember you can always quickly check changes that will come from consul to your fork by replacing **your_org_name** on the url: https://github.com/your_org_name/consul/compare/master...consul:master
|
||||||
|
|||||||
@@ -1 +1,61 @@
|
|||||||
# Manten tu fork actualizado
|
# Manten tu fork actualizado
|
||||||
|
|
||||||
|
## Configura tus servidores remotos de git
|
||||||
|
|
||||||
|
Si creaste correctamente tu fork y lo clonaste localmente, usando:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git remote -v
|
||||||
|
```
|
||||||
|
|
||||||
|
deberías ver algo como:
|
||||||
|
|
||||||
|
> origin git@github.com:your_user_name/consul.git (fetch)<br/>
|
||||||
|
> origin git@github.com:your_user_name/consul.git (push)
|
||||||
|
|
||||||
|
Ahora debes añadir el repositorio git de consul como servidor remoto con:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git add remote consul git@github.com:consul/consul.git
|
||||||
|
```
|
||||||
|
|
||||||
|
comprueba de nuevo que con:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git remote -v
|
||||||
|
```
|
||||||
|
|
||||||
|
deberías recibir algo como:
|
||||||
|
|
||||||
|
> consul git@github.com:consul/consul.git (fetch)<br/>
|
||||||
|
> consul git@github.com:consul/consul.git (push)<br/>
|
||||||
|
> origin git@github.com:your_user_name/consul.git (fetch)<br/>
|
||||||
|
> origin git@github.com:your_user_name/consul.git (push)
|
||||||
|
|
||||||
|
## Obteniendo cambios de consul
|
||||||
|
|
||||||
|
Empieza creando una rama **consul_pull** a partir de tu rama **master** sobre la que trabajar:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git checkout master
|
||||||
|
git checkout -b consul_pull
|
||||||
|
```
|
||||||
|
|
||||||
|
Obten los cambios de la rama **master** del servidor **consul** y unelos a los de la rama de trabajo:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git fetch consul
|
||||||
|
git merge consul/master
|
||||||
|
```
|
||||||
|
|
||||||
|
Tras el último comando, hay tres posibles escenarios:
|
||||||
|
|
||||||
|
1. Obtienes una respuesta `Already up-to-date.`. Eso significa que tu fork esta al dia con los cambios de consul 😊👌
|
||||||
|
|
||||||
|
2. Se abre una ventana del editor que tengas configurado en git, mostrando el mensaje de commit `Merge remote-tracking branch 'consul/master' into consul_pull`. Esto significa que git fue capaz de mezclar los cambios de consul sobre tu código sin encontrar problemas o conflictos. Termina el commit.
|
||||||
|
|
||||||
|
3. Recibes mensajes de error de git junto con un `Automatic merge failed; fix conflicts and then commit the result.`. Esto significa que se han encontrado conflictos entre los cambios en tu código y los cambios que se realizaron en consul desde la última vez que actualizaste tu fork. Esta es una de las principales razones para intentar mantener tu fork lo más al dia posible, realizando este proceso al menos mensualmente. Resuelve manualmente los conflictos para terminar el merge y haz un commit.
|
||||||
|
|
||||||
|
Now you can just simply push **consul_pull** branch to github and create a Pull Request so you can easily check all changes going into your repo, and see your tests suite runs.
|
||||||
|
|
||||||
|
Recuerda que siempre puedes comprobar rápidamente los cambios que tienes pendientes de integrar de consul a tu fork sustituyendo **your_org_name** en la url: https://github.com/your_org_name/consul/compare/master...consul:master
|
||||||
|
|||||||
Reference in New Issue
Block a user