Tagged: git

the hash code of the first commit


references

git rev-list --parents HEAD | egrep "^[a-f0-9]{40}$"
git rev-list --parents HEAD | tail -1
Advertisements

sharing dot files between computers using git


create a repository

As anyone might know, Bitbucket permits private repositories.

$ git pull git@bitbucket:<username>/dot-files.git

put dot files in it

$ cd dot-files/
$ mv ~/.shuttle.json .
$ mkdir .m2
$ cd .m2
$ mv ~/.m2/settings.xml .
$ mv ~/.m2/settings-security.xml .
$ cd ..
$ git add \*
$ git commit -m "dot files added"
$ git push

link dot files

$ cd ~
$ ln -s /path/to/the/dot-files/.shuttle.json
$ cd .m2
$ ln -s /path/to/the/dot-files/.m2/settings.xml
$ ln -s /path/to/the/dot-files/.m2/settings-security.xml

maven-release-plugin and git submodules


References

Problem

src/main/java 아래에 특정 폴더가 submodule 로 처리된 프로젝트를 평소와 같이 릴리즈 하였다.

$ git checkout -b release/test
$ mvn release:prepare release:perform
...
[INFO] Nothing to compile - all classes are up to date
...
$ 

target/checkout 폴더에서 submodule이 init 되지 않은 채 그대로 처리된다.

Solution

위 링크에서 제시된 해결책을 사용하여 해결하였다.

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <inherited>false</inherited> <!-- only execute these in the parent -->
  <executions>
    <execution>
      <id>git submodule update</id>
      <phase>initialize</phase>
      <configuration>
        <executable>git</executable>
        <arguments>
          <argument>submodule</argument>
          <argument>update</argument>
          <argument>--init</argument>
          <argument>--recursive</argument>
        </arguments>
      </configuration>
      <goals>
        <goal>exec</goal>
      </goals>
    </execution>
  </executions>
</plugin>