# A basic question about github

**URL:** <https://discourse.julialang.org/t/a-basic-question-about-github/15056>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [September 17, 2018, 9:07am UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056 "2018-09-17T09:07:13Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Post date:** [September 17, 2018, 9:07am UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/1 "2018-09-17T09:07:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 17, 2018, 9:27am UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/2 "2018-09-17T09:27:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Post date:** [September 17, 2018, 9:42am UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/3 "2018-09-17T09:42:06Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 17, 2018, 9:52am UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/4 "2018-09-17T09:52:48Z")

</div>

> [@tomtom](#):
>
> 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

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

```

---

<div class="post-metadata">

**Author:** ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Post date:** [September 17, 2018, 10:14am UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/5 "2018-09-17T10:14:06Z")

</div>

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

^^-- how? I mean, not using commands, but using [GitHub.com](http://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”.

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [September 17, 2018, 2:19pm UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/6 "2018-09-17T14:19:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Post date:** [September 17, 2018, 2:27pm UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/7 "2018-09-17T14:27:23Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [September 17, 2018, 3:02pm UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/8 "2018-09-17T15:02:49Z")

</div>

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](https://discourse.julialang.org/t/a-basic-question-about-github/15056/4) : 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.

---

<div class="post-metadata">

**Author:** ![mschauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mschauer/32/13946_2.png) [@mschauer](https://discourse.julialang.org/u/mschauer)\
**Post date:** [September 17, 2018, 3:03pm UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/9 "2018-09-17T15:03:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)\
**Post date:** [September 17, 2018, 3:13pm UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/10 "2018-09-17T15:13:54Z")

</div>

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](https://help.github.com/articles/syncing-a-fork/)

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

---

<div class="post-metadata">

**Author:** ![Stephen\_Vavasis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stephen_vavasis/32/3389_2.png) [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Post date:** [September 18, 2018, 3:48am UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/11 "2018-09-18T03:48:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Post date:** [September 18, 2018, 5:13am UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/12 "2018-09-18T05:13:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 18, 2018, 6:05am UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/13 "2018-09-18T06:05:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jmgnve](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmgnve/32/1906_2.png) [@jmgnve](https://discourse.julialang.org/u/jmgnve)\
**Post date:** [September 18, 2018, 7:30am UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/14 "2018-09-18T07:30:55Z")

</div>

I don´t have a black belt in git, so perhaps my advice is not very good. However, I found this [tutorial](https://gist.github.com/Chaser324/ce0505fbed06b947d962) on “GitHub Standard Fork & Pull Request Workflow” helpful. By the way, there are errors in the links in the [contributing](https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md) section at the julialang repo which this [pr](https://github.com/JuliaLang/julia/pull/27686) fixes, but it has been forgotten…

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [September 18, 2018, 5:54pm UTC](https://discourse.julialang.org/t/a-basic-question-about-github/15056/15 "2018-09-18T17:54:07Z")

</div>

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.
