Answer the question
In order to leave comments, you need to log in
Prevent a file from being committed without removing it from the (git) repository?
Hello! We are developing an application in Java + Hibernate, and to access the database, each developer has his own login / password, which are recorded in the persistence.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="defaultPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<property name="hibernate.connection.url" value="jdbc:mysql://localhost/hibernate_test" />
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.username" value="root" />
<property name="hibernate.connection.password" value="" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
</properties>
</persistence-unit>
</persistence>
Answer the question
In order to leave comments, you need to log in
You can use the merge strategy by specifying it in the .gitattributes file:persistence.xml merge=ours
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question