Git Product home page Git Product logo

Comments (4)

tarsius avatar tarsius commented on June 19, 2024

I am not sure what you are asking.

I was trying to fork emacs.g to a private fork

Github does not support creating private forks of public repositories I believe. So the first step is to create a new independent repository on Github.

Despite having tried various git clone --bare or git clone --mirror approaches I unfortunately can't seem to get this working at all.

But this sounds that creating a fork on Github is not what you are having issues with.

After creating the repository on Github do this:

git clone [email protected]:emacscollective/emacs.g.git
git remote add moesasji [email protected]:moesasji/emacs.g.git
git config remote.pushDefault moesasji
git push moesasji master

Then proceed with the initial setup as documented.

from emacs.g.

moesasji avatar moesasji commented on June 19, 2024

Thanks for the quick response. The reason I asked is that I am at the moment just genuinely confused how to work with emacs.g in combination with wanting to use a private repo.

One of the reasons for this confusion might be that I made the mistake to go for the "importing repositories" link, see: https://github.com/new/import This did give me a copy (clone?) of the repository including all branches, but with that it was really not clear to me at all how to track your changes. After that I went in the rabbit-hole of looking for the wrong thing (git clone --bare or git clone --mirror).

Your approach (using remote.pushdefault not with a capital) seems to be the step that I was missing although that way I can not see the branches in the github GUI until I explicitly check those out first.

The key-question is probably whether it is worth having a clear set of instructions like your above code-steps on how to set up a private repo that can track changes in emacs.g

from emacs.g.

tarsius avatar tarsius commented on June 19, 2024

One of the reasons for this confusion might be that I made the mistake to go for the "importing repositories" link, see: https://github.com/new/import This did give me a copy (clone?)

This created what is commonly known as a fork. I.e "a copy of a repository". Both the upstream repository and your fork are actual repositories, but they live on Github servers not your machine.

The tem clone commonly refers to a copy of a repository on a machine where you can directly interact with the repository, using your editor of choice and commands as git add.

The above process did involve such a clone, but in the last step it was removed. Also was a "bare clone"; a repository that did not contain a working tree. So you would not have been able to easily edit files and create new commits using that clone.

The sole purpose of that clone was to create "Github fork" of a "Github upstream", something that should be possible without this intermediate copy, but for no good reason Github disallows the creation of private forks so you had to jump through those hoops. Think of it as a complicated way of clicking on "Fork" on the Github website.


(using remote.pushdefault not with a capital)

remote.pushDefault (or remote.PuShDeFaUlT for that matter) work too.

Your approach [...] seems to be the step that I was missing although that way I can not see the branches in the github GUI until I explicitly check those out first.

Why do you even want to look at branches using github GUI (which I assume is the github webpage)?

All of this making sure all the branches exist everywhere seems completely unnecessary to me.

(1) git clone [email protected]:emacscollective/emacs.g.git
(2) git remote add moesasji [email protected]:moesasji/emacs.g.git
(3) git config remote.pushDefault moesasji
(4) git push moesasji master

(1) alone gives you a local copy of all the branch already. They just live in the refs/remotes/origin/* namespace instead of in refs/heads/*. These are called remote tracking branches. You also got a "real local copy" of the master branch (i.e. refs/heads/master). If and when you want to make changes to one of the other branches, then you can create your local copy using git checkout <branch>, which automatically creates refs/heads/<branch> from refs/remotes/origin/<branch> if necessary.

It seems that you additionally want to have a copy of every branch from emacscollective/emacs.g on moesasji/emacs.g. I see no need for that, but downsides. These copies will quickly be outdated and keeping them up-to-date will be complicated. (But if you insist on having a copy, then the instructions you linked to are the way to go.)

I would recommend that you only push branches to your fork that you yourself have actually created new commits on.


This is all just generic Git stuff, advanced Git stuff maybe, but generic never-the-less. I do not think this should be documented here and if you struggle with these things, then maybe you are not ready to use borg and emacs.g yet.

from emacs.g.

moesasji avatar moesasji commented on June 19, 2024

The confusion indeed results from not being able to use the forking through the Github GUI as allowed when both repos are public. If you consider this something that users of emacs.g should be able to figure out that is perfectly OK, so request closed.

from emacs.g.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.