Create Github repository from java [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I need to create remote Github repository using java (Using my credentials) and I need to push some code to that repo.
I saw some examples using JGit and some other references like
http://www.codeaffine.com/2015/11/30/jgit-clone-repository/ and https://github.com/kohsuke/github-api.
But I'm not able to understand fully.
// ------------ create the directory ---------
try (Git git = Git.init().setDirectory(localPath).call()) {
System.out.println("Having repository: " + git.getRepository().getDirectory());
}
I tried this one. I can only create repo in local.
So How can I push these changes to remote.
Thanks.

If you need to create a repository on GitHub, you need to use something that talks to the GitHub API like the lib of Kohsuke you linked to, or you need to talk to the API directly if you prefer.
If you also want to create a local Git repostory and push that to the remote, you additionally need to use e. g. JGit to either clone the repository you created or create a new repository, set the remote configuration to the repo created on GitHub and then push.

Related

How to publish an Android library from GitHub? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Recently I have been trying to figure out how to publish my ScaleNumberPicker Android library from GitHub.
I read articles about publishing to Jitpack, GitHub Packages and Maven Central, but I found it confusing.
What is the difference between these different package repositories, and which one is the best for Android Studio? And how do I publish? Do I need to create a release first on GitHub? And after publishing, can I modify the README.md file on my GitHub repository to add the usage instructions?
JitPack pulls the source from your GitHub repo and builds it (when the first user uses the lib).
For Maven Central and GitHub Packages, you build and upload your own artifacts.
I'd say, the simplest way is JitPack.
Follow the docs to publish the lib. (Follow the Guide to Android)
After adding a release, you still can edit the README, and you can continue to work on the lib.
If you want to publish a new version, just create a new release and update the README.

Reading Linux Repositories from Third Party [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am trying to create an app that would be able to generate kickstart scripts (along other things) and for one of the things to add was a list of packages you can install (obviously wont display them all, but will have a function to allow you to know if the package is available).
The problem I am finding is finding any documentation on how yum/apt read their repositories.
Does anyone know on where to find documentation on this sort of thing or if there is an open sourced app that does a simular thing (reading the repository that is)
APT and YUM repositories have different internal metadata formats:
APT: Can be parsed with libapt, or your own tools. It is pretty straightforward as the metadata format isn't too complicated.
YUM: Can be parsed with any XML library; the metadata is stored as XML and easily parsed with any XML library for any major programming language.
You can learn more about YUM repository metadata in this blog post. You can learn more about APT repository metadata in this blog post.

Maven: How to use a dependency that doesn't have it's own repo [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have one of my own custom projects that is an API. What I want to do with it is use it with another one of my projects, however I don't have a maven repository for it, so I cannot add it to the pom.xml for anyone to build
What do I need to do?
Thanks
I would modify the API project to be built as a Maven project, then run a Maven install against it, this should push it into your local repository and you should be able to use it from the Maven project like any other.
If your company also has a repository that it stores its own code too, something like Nexus, you would do a Maven Release and this would push it to that repository.
I've also found file system based repositories useful in situations like this. You don't need to be running Nexus or Artifactory or anything you just need to make sure all users have access to a shared drive.
As an example:
<repositories>
<repository>
<id>local-files</id>
<name>local-files</name>
<url>file://S:\filerepo</url>
</repository>
<repositories>

how to manipulate android libraries? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a library that I got it from github and I wanna make changes in some of the methods and layouts.how can I do it?
also I should say my workplace is AndroidStudio and use Gradle for adding library to my project.
Is there a way to manipulate gradle libraries?!
There are 2 solutions for these:-
u can download the .zip of the library modify it and import as a module in android studio project
clone the repository ,modify it and then upload it mavencentral so that u can use as dependency in studio or download .zip after modifying it and import as android studio project
If you use any function related with that library in your project you can access the specific class using Control + Left click on the function and go any deep you need. Then you can make it there the local modificacion of the library.
It is also not so recomended to make major changes.

Having multiple eclipse project in one Github repository [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I want to develop a multi-platform game using libGdx (for Desktop and Android).To share my work with some friends, I created a GitHub repository.
In ecplise, I have 3 different projects :
MyProject-core (most of the game)
MyProject-desktop (specific desktop code)
MyProject-android (specific android code)
I want to push them in my Github repository in 3 different folders.
Basicaly, I want my repository to look like this :
MyRepository
/core/
/desktop/
/android/
README.md
LICENCE.md
My question is, Should I use 3 different local git repositories, or should I just use 1 large repo?
It seems like you may want to use Git submodules.
You can have 1 main repo, with each of the other folders being a submodule, which is just a separate repo you pull down on checkout.
When pulling down your main repo you would do git submodule init which pulls down the other 3 repos/submodules.
The benefit of doing this instead of just having 1 repo with these 3 folders is that each repo with different codebases is essentially its own project, with its own language and set of issues.

Categories