How do I run ls-remote in libgit2sharp without a repository? - libgit2sharp

I would like to use libgit2sharp to run the equivalent of ls-remote for a remote not currently cloned on my system, the equivalent of:
git ls-remote http://www.kernel.org/pub/scm/git/git.git
In the tests, they all seem to begin with a repository cloning the remote, but I do not want to perform the clone just yet. I just want to make sure that I can communicate with the server.
I found this issue which talks about the same thing in the underlying library, but since there was no response yet, I wasn't sure if there is a way to do this or not?
Thanks!

How do I run ls-remote in libgit2sharp without a repository?
Current version (0.21) doesn't allow it.
Issue #985 has been created to keep track of this request. Feel free to subscribe to it to be notified of its eventual progress.

Related

Trying to pull updates from remote repo is failling for recently created branch

At work we have to use Bitbucket and to create the new branches we have to use the webpage.
When I do this and try to update my local repo using git pull I can see all the code, commits and even branches created by other users are pulled from remote except for the branch I recently created.
Then I have to keep trying git pull and see the message Already up to date. for 15 or 20 minutes until suddenly the branch is updated.
I was using https to clone the repos and I realized that using SSH started to avoid this issue, but a few weeks later I'm starting to see this issue again with SSH as well.
I'm assuming the issue is related to Bitbucket but I haven't found any info.
Is there a way to avoid this? or maybe a way to force the update?
Try first a git fetch, or even a git ls-remote
The goal for the ls-remote command is to check (right after creating/pushing a new branch) if:
said new branch is immediately listed in the remote tracking branches listed by ls-remote
the associated HEAD SHA1 for that branch is the right commit (the latest pushed on that branch)

Why Git clone from Gerrit(port 29418) is much slower than Git(port 22)

As the title describe.
I made many test on this.
And how can I speed up Gerrit Server?
Once cloned, check what is is fetching with:
time b git fetch --all -v
If you see many origin/branches, you might to cleanup old Gerrit branches in order to not clone/fetch so many branches.
Check also if "Git port 22" refers to the same Gerrit server, or to another Git hosting service: in the latter case, any comparison would be unfair.

How to do I get a log of changes from Bitbucket (like `git log`) but without cloning the repo?

I am looking to run the command git log --since="2 weeks ago" --stat --oneline on a git repository without requiring the clone. I am attempting to track changes made over a time period (using since) down to the specific files to commit.
The by commit is not required but, it is a nice to have. I would prefer to not clone down each repository so interfacing with the Bitbucket API would be optimal. I do have physical access to the git repositories. If required I could use the --git-dir command.

How to push changes from Bitbucket to Heroku

I'm new to programming, learnt languages but this part I have no clue.
I'm working on a app that is on bitbucket and on Heroku cloud.
I am not exactly very clear how the bibucket repository interacts with Heroku and also my local offline commandprompt+sublimetext+PG database.
So what I'm doing is i have made some changes physically on Bitbucket (manually on their website) based on the changes Ive made and viewed (offline on localhost 3000) and wanted to push it to Heroku to have the changes online. There does not seem to be any buttons on bitbucket for that purposes and I guess I have to do it through the command prompt.
In that case how do I make those changes (command lines) and update the sublime+PG on the local server? I seen a few codes on git and suspect those are it (like git push -v) which lists the repositories but I don't wish to test and end up screwing the codes. Please advise if there are easier to do any of the above.
Note that I want the changes to be on Heroku because of this error.
Rails 4 Relationship Issue extended
Also what the difference between pulling and pushing changes? I'm reading the git definitions but it isn't saying much. Just that pull is pulling data from other repository to I'm not sure where. Push is to update remote refs with associated objects.
Many thanks!
Because you're new, let me explain what you need:
Heroku uses an amazing deployment process which based on the git scm
system. This means that you just need to "push" your git
respository to Heroku in order for it to deploy your latest revision
of code
The problem you cited is you're trying to push from bitbucket
directly. Bitbucket / github are essentially just cloud
repositories where you can store your code, and is not where Heroku
can "read" your files from
To get this working, as you've stated in your comments, you need to push from your computer. This is achieved by creating a remote repository for Heroku, and then pushing to that, like this:
$ git remote add heroku git#heroku.com:yourherokuapp.git
$ git add .
$ git commit -a -m "Latest Commit"
$ git push heroku master

Is there a way I can view changes committed to my local GitHub branch without having to push it to the master branch?

I'm still figuring GitHub and Heroku out, so please bear with me. :)
I've a web app on, say, xyz.com. What I am doing now is to make some code/UI changes on some files, commit those files, push them to the master branch, and then refreshing the url to see these changes.
I think this is obviously the wrong approach, but I don't know of how else to test changes done to my code without having to push them on to the master branch. How could I do so?
I don't quite understand the situation in the full version of your question (see my comment and, as icc asks, why can't you test locally?), but to answer the question in the title, you can see the differences between your master and the version on GitHub by running:
git fetch github
git diff github/master master
(That's assuming that the remote that refers to your GitHub repository is called github - it might well be origin in your case. You can see all your remotes with git remote -v.)
To explain that a little further, when you run git fetch github, git will update all your so-called "remote-tracking branches" - in most cases those are the ones that look like origin/whatever, github/experiment, etc. Those are like a cache of the state of those branches, and they're only updated when you run git fetch or successfully git push to that branch on the remote repository. So, once you've done this to make sure that github/master is a recent snapshot of that branch on GitHub, you can happily compare it with your local master branch using git diff.
First: You don't push to the master branch, you push to a remote repo. You should probably read up on your git.
Second: This is not a good workflow, first you should commit your changes and then test them locally. When you are done testing you are ready to push your commits to a remote repo.

Resources