Update fork update section with release by release update tips

This commit is contained in:
Bertocq
2017-11-20 18:03:26 +01:00
parent f87d304620
commit 2d68e78505
2 changed files with 30 additions and 19 deletions

View File

@@ -12,7 +12,7 @@ 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 as upstream remote with:
Now we have to add CONSUL's github as upstream remote with:
```bash
git remote add upstream git@github.com:consul/consul.git
@@ -31,9 +31,9 @@ again you should get:
> 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
## Pulling changes from CONSUL
Start by creating a branch named **upstream** from your **master** branch to apply consul changes:
Start by creating a branch named **upstream** from your **master** branch to apply CONSUL changes:
```bash
git checkout master
@@ -41,21 +41,26 @@ git pull
git checkout -b upstream
```
Then we fetch changes from **consul** remote server and it's master branch on to our feature branch:
Then we can fetch all changes from **consul** remote server with:
```bash
git fetch upstream
git merge upstream/master
```
Now there are three possible outcomes:
And then you can choose to either:
A. Get all the latest changes on CONSUL's **master** branch with `git merge upstream/master`
B. Just update up to an specific release tag (so you can do incremental updates if you're more than one release behind). For example to update up to [v0.9](https://github.com/consul/consul/releases/tag/v0.9) release just: `git merge v0.9`
## Merging changes
After the previous section `merge` command, there are three possible outcomes:
A. You get a nice `Already up-to-date.` response. That means your fork is up to date with consul 😊👌
B. You get a screen on your git configured editor showing the commit message `Merge remote-tracking branch 'upstream/master' into upstream`. 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.
B. You get a screen on your git configured editor showing the commit message `Merge remote-tracking branch 'upstream/master' into upstream`. 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.
C. 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.
C. 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 your **upstream** 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
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

View File

@@ -13,7 +13,7 @@ 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:
Ahora debes añadir el repositorio git de CONSUL como servidor remoto con:
```bash
git remote add upstream git@github.com:consul/consul.git
@@ -38,24 +38,30 @@ Empieza creando una rama **upstream** a partir de tu rama **master** sobre la qu
```bash
git checkout master
git pull
git checkout -b upstream
```
Obten los cambios de la rama **master** del servidor **consul** y unelos a los de la rama de trabajo:
Y actualiza la información del repositorio de consul con las referencias a las ramas, tags, etc..:
```bash
git fetch upstream
git merge upstream/master
```
Tras el último comando, hay tres posibles escenarios:
Y por fin puedes elegir entre:
A. Obtienes una respuesta `Already up-to-date.`. Eso significa que tu fork esta al dia con los cambios de consul 😊👌
A. Actualizar con los últimos cambios de la rama **master** usando `git merge upstream/master`
B. Sólo actualizar hasta cierta versión (en el caso de que prefieras actualizar de forma incremental, si estas varias versiones por detrás). Por ejemplo para actualizarte a la versión [v0.9](https://github.com/consul/consul/releases/tag/v0.9) utilizamos el tag asociado: `git merge v0.9`
B. Se abre una ventana del editor que tengas configurado en git, mostrando el mensaje de commit `Merge remote-tracking branch 'upstream/master' into upstream`. Esto significa que git fue capaz de mezclar los cambios de consul sobre tu código sin encontrar problemas o conflictos. Termina el commit.
## Fusionando cambios
C. 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.
Tras el `merge` de la anterior sección, hay tres posibles escenarios:
A. Obtienes una respuesta `Already up-to-date.`. Eso significa que tu fork esta al dia con los cambios de CONSUL 😊👌
B. Se abre una ventana del editor que tengas configurado en git, mostrando el mensaje de commit `Merge remote-tracking branch 'upstream/master' into upstream`. Esto significa que git fue capaz de mezclar los cambios de CONSUL sobre tu código sin encontrar problemas o conflictos. Termina el commit.
C. 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 **upstream** 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
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