Tag: java

How to get all commits without downloading to local system with JGit?

that I need to get all commits from a remote repository. This is how I clone a repository to a local system, but it’s not a good idea to download all files because there is so much. git = Git.cloneRepository().setURI(repo).setDirectory(pathGit).call(); File pathRepo = new File(pathGit.getPath() + “/.git”); repository = FileRepositoryBuilder.create(pathRepo); How to resolve this issue?

Clone git repository in eclipse

I’m new to git, as I found to download files the path should end with .git extention. The sources I need are stored here https://dev.vaadin.com/git/. How can I take for example addons/calendar/calendar.git sources?

When using a local file for a JComponent, is there a way to not hard code the file path?

I wanna upload my project, a card game to Github, and it has a picture from my hard drive as the game card table. Is there a way to compile/run and upload it without the code having the entire file path hard coded into it? As of now, its: public static void main(String[] args){ JFrame […]

addFilePattern does not throw FileNotFoundException if file to be added is not present

I have written a java program to push to a git repository where I am pushing specific files at a time instead of pushing all files. try { git.add().addFilePattern(“files\\file1.txt”).call(); } catch (Exception e) { e.printStackTrace(); } But if file1.txt is not present, the catch block is not entered. If I do the same thing with […]

execute git blame command in java

I’m trying to use the following Java syntax to execute a Git blame command: Process process = Runtime.getRuntime().exec(“/usr/bin/git blame https://github.com/git/git/alloc.c > TestGit.txt”); But, when I run the code in Java, it doesn’t give any result. And, when I tried to execute it in the Terminal, it just creates an empty “TestGit.txt” file, and I got […]

Git exception in Eclipse when code not using git

I get this error whenever I open an external folder from inside my running Java program: fatal: Not a git repository (or any of the parent directories): .git As far as I can tell, everything is working perfectly and the error perplexes me. The code used to open the folder: File file = new File(saveDirectory); […]

Is Git Smart Enough to Merge After Refactoring

Assume I have a class. package org.my.domain; public class BestClassEver{} My Workflow Through some refactoring, I change this class’s package. package org.another.domain; public class BestClassEver{} I commit this to my local repository using git and push it to a remote repository. git add . git commit -m “Refactoring” git push origin master Another Developer’s Workflow […]

Git: special operations for add, commit, or push when lots of changes exist?

My understanding of git add is that you’re basically saying to your local git repo “Yes, I’m sure I want to make these changes.” My understanding of git commit is to actually save the changes to your local HEAD branch. At this point they are actually in version control, but are only local to your […]

Is there library of git for android

I wanted to make an app that uses git as its backend and does something like pull/fetch/ etc by just pressing button on android. Then all the information about the repo is displayed in the listview. I am able to create the listview but I am searching for the library that could help to do […]

App-Updater from git repo

I’d like to make an auto updater for my (Swing based) Java Applications, which automatically downloads the newest version from a git repository and updates itself. Can you give me some links or explanations?

Git Baby is a git and github fan, let's start git clone.