Created
July 12, 2016 06:38
-
-
Save kristofmeixner/cc0d6bee550b701ab3c2ae6add75aee8 to your computer and use it in GitHub Desktop.
Creating the CSV and metadata branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Git git = new Git(repository); | |
// Creating the master branch if it doesn't exist | |
ObjectId head = repository.resolve("refs/heads/master"); | |
if (head != null) { return; } | |
// Creating the initial commit on the branch | |
git.commit().setMessage("Initial commit").call(); | |
String readmeFileName = "README.md"; | |
String[] text = new String[] {"DO NOT DELETE DIR"}; | |
Files.write(Paths.get(getWorkingTreeDir(), readmeFileName), Arrays.asList(text)); | |
git.add().addFilepattern(readmeFileName).call(); | |
PersonIdent personIdent = new PersonIdent("Jane Doe","[email protected]"); | |
git.commit().setMessage("README.md").setAuthor(personIdent).call(); | |
// Creating the orphaned queries branch if it doesn't exist | |
ObjectId head = repository.resolve("refs/heads/queries"); | |
if (head != null) { return; } | |
// Creating the initial commit on the branch | |
git.checkout().setName("queries").setOrphan(true).call(); | |
git.commit().setMessage("Initial commit").call(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment