arregla conflictos para git merge branch to master

¿Cómo fusiono esta twig para dominar?

[email protected]:~/NetBeansProjects$ [email protected]:~/NetBeansProjects$ git clone -b 4.GUI_loading_messages_slowly [email protected]github.com:THUFIR/USENET.git Cloning into USENET... remote: Counting objects: 3782, done. remote: Compressing objects: 100% (1274/1274), done. remote: Total 3782 (delta 1647), reused 3613 (delta 1478) Receiving objects: 100% (3782/3782), 388.55 KiB | 100 KiB/s, done. Resolving deltas: 100% (1647/1647), done. [email protected]:~/NetBeansProjects$ [email protected]:~/NetBeansProjects$ cd USENET [email protected]:~/NetBeansProjects/USENET$ [email protected]:~/NetBeansProjects/USENET$ git branch -a * 4.GUI_loading_messages_slowly remotes/origin/1.FetchBean_CLI remotes/origin/2.some_GUI remotes/origin/3.messageId__string remotes/origin/4.GUI_loading_messages_slowly remotes/origin/HEAD -> origin/master remotes/origin/master [email protected]:~/NetBeansProjects/USENET$ [email protected]:~/NetBeansProjects/USENET$ git checkout -b master remotes/origin/master Branch master set up to track remote branch master from origin. Switched to a new branch 'master' [email protected]:~/NetBeansProjects/USENET$ [email protected]:~/NetBeansProjects/USENET$ git branch 4.GUI_loading_messages_slowly * master [email protected]:~/NetBeansProjects/USENET$ [email protected]:~/NetBeansProjects/USENET$ git diff master 4.GUI_loading_messages_slowly diff --git a/src/META-INF/persistence.xml b/src/META-INF/persistence.xml index 252f563..3cebe3d 100644 --- a/src/META-INF/persistence.xml +++ b/src/META-INF/persistence.xml @@ -2,8 +2,8 @@ <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http:/ <persistence-unit name="USENETPU" transaction-type="RESOURCE_LOCAL"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> - <class>net.bounceme.dur.usenet.database.Article</class> - <class>net.bounceme.dur.usenet.database.Headers</class> + <class>net.bounceme.dur.usenet.model.Article</class> + <class>net.bounceme.dur.usenet.model.Newsgroup</class> <properties> <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/usenet <property name="javax.persistence.jdbc.password" value="password"/> diff --git a/src/net/bounceme/dur/usenet/controller/ArticleNewsgroup.java b/src/net/bounceme index b65737a..a9fadd2 100644 --- a/src/net/bounceme/dur/usenet/controller/ArticleNewsgroup.java +++ b/src/net/bounceme/dur/usenet/controller/ArticleNewsgroup.java @@ -5,8 +5,8 @@ import java.util.logging.Level; import java.util.logging.Logger; import javax.mail.Message; import javax.mail.MessagingException; -import net.bounceme.dur.usenet.database.Article; -import net.bounceme.dur.usenet.database.Headers; +import net.bounceme.dur.usenet.model.Article; +import net.bounceme.dur.usenet.model.Newsgroup; import net.bounceme.dur.usenet.model.Usenet; [email protected]:~/NetBeansProjects/USENET$ [email protected]:~/NetBeansProjects/USENET$ git merge 4.GUI_loading_messages_slowly Auto-merging src/net/bounceme/dur/usenet/controller/Page.java CONFLICT (content): Merge conflict in src/net/bounceme/dur/usenet/controller/Page.java Auto-merging src/net/bounceme/dur/usenet/database/DatabaseUtils.java CONFLICT (content): Merge conflict in src/net/bounceme/dur/usenet/database/DatabaseUtils.java Auto-merging src/net/bounceme/dur/usenet/model/Usenet.java CONFLICT (content): Merge conflict in src/net/bounceme/dur/usenet/model/Usenet.java Automatic merge failed; fix conflicts and then commit the result. [email protected]:~/NetBeansProjects/USENET$ [email protected]:~/NetBeansProjects/USENET$ 

No es tanto que quiera "arreglar" los conflictos sino simplemente replace el maestro con la twig. Tal vez rebase ?

 git checkout master git merge GUI_loading_messages_slowly git commit git push 

Siempre cambia a la twig, que desea modificar. Entonces, primero verificando maestro es correcto para tu caso. Si su combinación salió mal, puede con "reiniciar" la fusión de Git.

cambie a la twig que desea fusionar y escribir.

 git merge branchname 

Pero deberías leer los conceptos básicos y la documentation al principio.

Tutoriales

La fusión funcionó según lo anunciado, pero solo después de eliminar la twig principal:

 [email protected]:~/NetBeansProjects$ [email protected]:~/NetBeansProjects$ git clone [email protected]:THUFIR/usenet.git Cloning into usenet... remote: Counting objects: 3750, done. remote: Compressing objects: 100% (1263/1263), done. remote: Total 3750 (delta 1630), reused 3585 (delta 1465) Receiving objects: 100% (3750/3750), 385.93 KiB | 85 KiB/s, done. Resolving deltas: 100% (1630/1630), done. [email protected]:~/NetBeansProjects$ [email protected]:~/NetBeansProjects$ cd usenet/ [email protected]:~/NetBeansProjects/usenet$ [email protected]:~/NetBeansProjects/usenet$ git branch -a * 4.GUI_loading_messages_slowly remotes/origin/1.FetchBean_CLI remotes/origin/2.some_GUI remotes/origin/3.messageId__string remotes/origin/4.GUI_loading_messages_slowly remotes/origin/HEAD -> origin/4.GUI_loading_messages_slowly [email protected]:~/NetBeansProjects/usenet$ [email protected]:~/NetBeansProjects/usenet$ git branch master [email protected]:~/NetBeansProjects/usenet$ [email protected]:~/NetBeansProjects/usenet$ git branch * 4.GUI_loading_messages_slowly master [email protected]:~/NetBeansProjects/usenet$ [email protected]:~/NetBeansProjects/usenet$ git checkout master Switched to branch 'master' [email protected]:~/NetBeansProjects/usenet$ [email protected]:~/NetBeansProjects/usenet$ git branch 4.GUI_loading_messages_slowly * master [email protected]:~/NetBeansProjects/usenet$ git branch -a 4.GUI_loading_messages_slowly * master remotes/origin/1.FetchBean_CLI remotes/origin/2.some_GUI remotes/origin/3.messageId__string remotes/origin/4.GUI_loading_messages_slowly remotes/origin/HEAD -> origin/4.GUI_loading_messages_slowly [email protected]:~/NetBeansProjects/usenet$ [email protected]:~/NetBeansProjects/usenet$ git merge 4.GUI_loading_messages_slowly Already up-to-date. [email protected]:~/NetBeansProjects/usenet$ [email protected]:~/NetBeansProjects/usenet$ git push origin master Total 0 (delta 0), reused 0 (delta 0) To [email protected]:THUFIR/usenet.git * [new branch] master -> master [email protected]:~/NetBeansProjects/usenet$ 

La fusión solo funcionó porque primero eliminé la twig principal, lo que parece un poco extremo, pero ahí lo tienes. De lo contrario, no estaba seguro de cómo solucionar los conflictos sin, como sugiere el manual fino, la edición de los files para que coincidan. Simplemente no entiendo el punto de una fusión si primero tiene que editar manualmente las cosas para que coincidan con una twig diferente, parece que debe haber un aviso al respecto, no un post de error.

Con la condición de que no se puede eliminar la twig maestra con push origin :master en github sin cambiar primero la twig pnetworkingeterminada, easy peasy. Me resulta algo irritante que la fusión no siempre se fusione automágicamente, y algunas veces se resquebrajará que haya conflictos. No veo por qué la fusión no puede devolver un aviso, y luego pregunto "¿estás seguro?" y luego fusionar de todos modos. En cualquier caso, aprendí un (pequeño) sobre git, en particular cómo eliminar una twig.

No entiendo el significado de Already up-to-date. , Quiero decir, el origen en github ciertamente no está actualizado, entonces me pregunto qué estará actualizado. Presumiblemente, la copy local está actualizada ahora, pero ¿por qué está "ya" actualizada?