How to view diff of a forked github project

Online solution: get /repos/{owner}/{repo}/compare/{base}…{head} The “compare two commits” API does support multiple repositories: Both :base and :head must be branch names in :repo. To compare branches across other repositories in the same network as :repo, use the format <USERNAME>:branch. Example: https://api.github.com/repos/octocat/hello-world/compare/master…abejpn:master Or with a GitHub URL: https://github.com/octocat/Hello-World/compare/master…abejpn:master Original answer 2010: Add the original GitHub repo …

Read more

Swap git submodule with own fork

The submodules are stored in .gitmodules: $ cat .gitmodules [submodule “ext/google-maps”] path = ext/google-maps url = git://git.naquadah.org/google-maps.git If you edit the url with a text editor, you need to run the following: $ git submodule sync This updates .git/config which contains a copy of this submodule list (you could also just edit the relevant [submodule] …

Read more

error: pathspec ‘test-branch’ did not match any file(s) known to git

The modern Git should able to detect remote branches and create a local one on checkout. However if you did a shallow clone (e.g. with –depth 1), try the following commands to correct it: git config remote.origin.fetch ‘+refs/heads/*:refs/remotes/origin/*’ git fetch –all and try to checkout out the branch again. Alternatively try to unshallow your clone, …

Read more

Can forks be synced automatically in GitHub?

For the record, recently I ran into this same problem and addressed it with Github Actions. The solution is rather easy: an scheduled action fetches the upstream repository and merges it into mine. # .github/workflows/example.yml name: Merge upstream branches on: schedule: # actually, ~5 minutes is the highest # effective frequency you will get – …

Read more