Dipping a toe in git

1 minute read

I’ve run into some limitations of the EnVers addon to Hibernate that required me to dig into the Hibernate source code and look at pushing up some changes. Luckily the Hibernate Core is now hosted on github so this makes it easy to fork and post my updates.

The discussion on my changes for EnVers are outlined in this discussion.

So first step was to create my own fork of hibernate-core and then create a branch from the 4.0.0.Final tag on the hibernate-core repo.

Then cloning the repo to my local machine was as simple as:

git clone https://stevemac007@github.com/stevemac007/hibernate-core.git

A few simple commits later and I had a working solution.

Then my first git gotcha. I made a change and did a local commit, and then pushed the change upstream. But I had missed a file.
That’s OK from what I know you CAN amend the previous commit, and so I did. It committed locally fine, but when I tried to push the change back upstream it failed.

I’m not sure how I need to get out of this sticky situation so I have just deleted my local clone and re-cloned the repository.

After the fact I found that I might have been able to do this to fix my problem.

I’m going to create a new test branch and see how I can fix this and will update back here how to I go.