View a pull request with Kaleidoscope - kaleidoscope

I would prefer to look at the contents of a pending github pull request in Kaleidoscope instead of the github UI. Is there a way to do this?

One solution that I've found, in the case where your PR is coming from a different branch on the same repo, is to pull down the branch and then run the following
git difftool master..branch_name

Related

How to get pull request by id using JGit

I've started using JGit for achieving git api calls through java based jGit lib.
I'm looking to get stats around what has changed in pullRequest in files for that I'll need to get details of pullRequest.
I'm facing challenges in finding approach in getting pull request by ID using JGit.
There is no clear and concise documentation, the cook-book also don't cover this portion.
PullRequests are not part of core Git, so JGit also does not have support.
So it depends on which Git server you are accessing, GitHub has support via special branches, e.g.
git fetch origin pull/ID/head:BRANCHNAME
e.g.
git fetch origin pull/223/head:local_test_branch
A similar fetch-command via JGit should work as well.
See https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/checking-out-pull-requests-locally for details

Keeping a custom theme up to date with upstream

My team will be working on a Wordpress project (theme), and we're looking to build using the Foundation CSS framework. Additionally, we will be making use of Git as source control.
We've discovered the Foundationpress theme, and would like to use it as a starting point: https://github.com/olefredrik/FoundationPress
We would only want to do this once in a while, ie maybe there is a bug in the current version that gets fixed.
My question is, how can we keep up to date with changes to the Foundationpress theme selectively?
ie: Should I fork the project, and change the remote origin to our Github repository, and add a secondary remote for the Foundationpress repo, and then only pull down changes from the Foundationpress remote when needed? I'm just not really sure what the best practice is.
Maybe there's a better way to handle this entirely. Thank you!
Even if you fork the olefredrik/FoundationPress, your fork repo will not contain the update changes that olefredrik/FoundationPress made.
If you don’t need to contribute for olefredrik/FoundationPress, and you already have your own remote repo you want to work on, you can directly add remote by git remote add upstream https://github.com/olefredrik/FoundationPress.git, and check if there has update by
git fetch upstream
git log master..upstream/master
If there has output, that means olefredrik/FoundationPress has new commit(s) which is(are) not contains in your local repo. You can use git pull upstream master to pull the new changes.
If you need to contribute for olefredrik/FoundationPress or you don’t have your own remote repo, so you can fork it and check if there has update changes by the same way above.

JGit plumbing API - commit new or modified file to non-current branch

Sorry, relative novice, but I have not been able to find specific example to address this. Working on a service that is using Git to store configuration documents. They would be worked on in branches until "published".
I've been able to do all the querying and fetching of documents from any branch in the local repository where the service would run, without having to "checkout" branch into working directory. I would like to do the same with a save operation.
I've found examples of using ObjectInserter, TreeFormatter and CommitBuilder to do this, but no explicit/explained example of doing this to specific branch that would produce the same results as switching, adding and committing with porcelain API.
I've played around with RefUpdate after the commit, and think I'm on the right track, but could use some help.
Thanks in advance

R: RStudio: How to check out an existing branch, modify it and commit back to GitHub (Windows machine)

I have followed every advice on http://r-pkgs.had.co.nz/git.html and on the subsection http://r-pkgs.had.co.nz/git.html#git-branch and I am still getting error.
The steps I need/did (different from what Hadley's page dictates).
grab URL of GitHub repo (e.g, https://github.com/OHDSI/Achilles.git )
create versioned project in RStudio with this URL
set up my global user names for git
select a dev branch here (for example devXYZ)
At this point I got "detached at origin/devXYZ) message.
Per instructions in Hadley book - I tried to do fix this using this command
git push --set-upstream origin devXYZ
but it fails. The error is: origin does not appear to be a git repository or src refspec devXYZ does not match any
I tried fixing it with doing this command (may be wrong)
git remote add origin https://github.com/OHDSI/Achilles.git
I am using windows, latest R, latest RStudio, latest git from https://git-scm.com/download/win
EDIT: I also tried making a new branch using the recommended mechanism but it also fails. The goal is to get instructions where there is not git init and the whole process starts with an URL and new project in RStudio.
The desired future steps to work would be 5. modify and commit into the devXYZ branch.
THIS ONLY APPLIES TO NON-MASTER BRANCHES:
If you are newbie to git - simply don't try to do the git part in R at all.
Instead, use GitHub Desktop or SourceTree.
Point that tool to the desired repo, switch to desired branch
Start RStudio and do any development
Close RStudio and use that external tool to perform any git steps.
FOR MASTER BRANCHES:
integrated RStudio git implementation works great.
I think I might know what the problem is. You're trying to push directly to the main repo. I'm guessing you're not one of the main contributors for that repo so it won't allow you to create a branch there directly. I'm guessing in that book he's probably using his own repository as an example rather than using an existing one
The reason you're getting that error is because that branch doesn't exist on the remote repo so it can't get the reference to it which is inferred from this src refspec devXYZ does not match any
The preferred workflow is to work on a fork of the main repo (basically its your own personal copy of the main repo that is stored on the server). Even if you end up as a contributor at some point I think this is a good workflow to follow
Here's a good explanation on how use the fork workflow. There's other information on stackoverflow as well
Once you've made updates you'd create what's called a pull request to the original repo (commonly referred to as upstream). This basically is a request to merge your changes from the fork into the main repo. This allows the repo owner to review the changes and decide whether to accept them or make changes
Since you're just going over a tutorial I'd say use your fork as the origin wherever its used in the book for now

How to view GitHub Contributors Graph for branches other than master?

At https://github.com/yourusername/yourreponame/graphs you can find some nice graphs showing commits over time. However the information is only for the master branch.
How do I see the same information for a branch other than master, or see a graphs taking account commits across all branches?
If this is not possible, how can I at least see how many line of code have been committed under a particular branch via the GitHub web GUI?
Is any of this possible?
I just stumble on this as well. You can actually see the graphs for other branches than the Master branch.
On Github in your repo - choose settings.
In settings - change your default branch to whatever branch you would like to see the graphs for.
The help of Github: Viewing contributions :
Whenever you commit to a project's default branch (or the gh-pages branch), open an issue, or propose a Pull Request, we count that as a contribution.
So:
default branch
gh-pages branch
open an issue
pull request
only these will be counted.
As #Mikael 's answer, you can change the default branch in repo's settings.
Another help of Github: Which contributions are counted?
For commit:
Your commit contributions are only counted when they are created on or merged into the default branch or gh-pages branch of a non-fork repository.
I also want github to count all the commits, not specified branch :(
From what I can see, those graphs are for master only: I only committed on the branch gitlist recently, and my commit activity only shows those for master.
Unless you rebase your branch on top of a new repo you would create specifically for that kind of inspection, said branch activity won't be visible until it is merged back in master.

Resources