A basic question about github

hello … I have a very elementary question about using GitHub…

I’ve forked JuliaLang/julia, and it creates a githubtomtom/julia repository in my GitHub account …

now I see This branch is 4 commits ahead, 8 commits behind JuliaLang:master.

How could I “catchup” (i.e. fetch?) the latest version from JuliaLang/julia ?

searching around in Google, it gives a lot of command line things… I believe this fetching could be done purely on GitHub web, is it?

Thanks.

There is little point in updating the fork per se, as presumably you would work on an actual local clone.

If you want to make a PR, a typical workflow is

  1. cloning the Julia repo (you will be on master),
  2. create a branch, eg tt/fix-everything,
  3. push that to your fork on Github and make a PR.

ah … I know how to create branch, modify code, then PR (hopefully).

but the situation now is: I wanna make my repository sync with (catchup) JuliaLang/julia … how to do it?

If I could not catchup, my repository could be more and more outdated over time …

Why is this precisely a concern? As I said, you would work on your local clone, which you would keep up to date. But if you really insist, I believe you can

git checkout master
git pull origin master # assuming origin is the official julia repo
git push myremote master # myremote is your Github repo

you would work on your local clone, which you would keep up to date

^^-- how? I mean, not using commands, but using GitHub.com web, is it possible?

purely using the web means that I’m not keeping a local set of copy … I could just create a branch and modify the code “on the web”.

The Web interface is really only suitable for minor edits. For anything more than that you will want to work on a local copy with your standard editor etc.

1 Like

oic. thanks.

anyway, I found out that (maybe the only possible) way to “fetch” using the Web Interface is to:

  1. delete the forked repository
  2. fork again from JuliaLang/julia

That’s a really inefficient way of doing it. A better alternative has been mentioned in A basic question about github - #4 by Tamas_Papp : pull followed by a push, but it requires a local clone.

I don’t understand the use case of needing to keep your fork current.

1 Like

You are likely operating under some wrong assumptions. What do you want to do? E.g, why do you think having an up-to-date copy of the julia github repo is useful for you?

Remember, you are working with two repositories. One that is on your local computer, one that is on Github, (and third on JuliaLang/Julia).

It’s important to keep your local copy (the one on your computer synced) with the Julia master. This is done by following the instructions on Syncing a fork - GitHub Docs

Then, you can a) push your local copy, with all the changes you just pulled, to your github repository. Now that your local and remote are synced, you create a branch, work on a PR, then push your changes again to your github OR b) you realize that once you sync your local, there is no need to push the changes to your github right away. You can now create a branch, work on a PR, and THEN sync all of this to your GitHub repository, which will then allow you to submit your PR to Julia.

I usually do the “b” workflow

1 Like

I occasionally make PR’s for corrections or clarifications to the documentation. This is relatively easy to do entirely on github without pulling the repo to my local drive. However, if a six-month interval passes between my documentation PR’s, then my branch on github is hopelessly out of date. So I do exactly as the OP suggested: delete my entire julia repository on github and start over.

1 Like

another method is to use the application GitHub Desktop. It has a bottom for pull origin.

This isn’t another method, just a GUI for the same thing.

I don´t have a black belt in git, so perhaps my advice is not very good. However, I found this tutorial on “GitHub Standard Fork & Pull Request Workflow” helpful. By the way, there are errors in the links in the contributing section at the julialang repo which this pr fixes, but it has been forgotten…

1 Like

I don’t understand why you would try to avoid using CLI.

As others have said, if you have commits/unstaged changes, you won’t want to delete your local copy and clone again, instead, you should google up how git rebase work.

1 Like