0

I am having trouble separating the Aquamacs24 nightly build branch from the master on my computer using the GitHub application and also with the terminal.

The master (1.58 GB) is located here:

$ git clone git://github.com/davidswelt/aquamacs-emacs.git

The Aquamacs24 branch (182.5 MB) is located here:

https://github.com/davidswelt/aquamacs-emacs/tree/aquamacs24

I've tried several variations in the terminal, but I'm not getting the same files as just clicking on the ZIP option in the link mentioned above, and checkout is not working:

$ git clone --depth 3 git://github.com/davidswelt/aquamacs-emacs.git
$ cd aquamacs-emacs
$ git checkout aquamacs24

Is there a way to separate the branch from the master once the entire 1.58 GB master is downloaded to the computer? Alternatively, what is the exact terminal command that will download the same thing as clicking on the ZIP icon on the github webpage cited above?

phils
  • 71,335
  • 11
  • 153
  • 198
lawlist
  • 13,099
  • 3
  • 49
  • 158

1 Answers1

1

I'd mark this a duplicate, except (a) I'm not 100% sure I understand what you mean by "separating", and (b) what "the same thing as clicking on the ZIP icon" is will very much depend on whether that button performs a dynamic git archive on demand, or whether the archives are pre-generated (in which case they might not match the current HEAD).

(I would imagine that they are dynamic, however; or at least that github invalidates any cached copy if it is no longer current).

What does "checkout is not working" mean?

Anyhow, if you wish to clone a specific branch without downloading the other branches, that's been asked and answered: https://stackoverflow.com/a/7349740/324105

or if you're using git 1.7.10 or later: https://stackoverflow.com/a/14930421/324105

Community
  • 1
  • 1
phils
  • 71,335
  • 11
  • 153
  • 198
  • Is there any possibility you could take a look at the code in my question and tell me which line is incorrect, and suggest an alternative line of code that works for Aquamacs24? I'll post the error message in a few minutes . . . . – lawlist May 05 '13 at 03:57
  • `git checkout aquamacs24`: `error: pathspec 'aquamacs24' did not match any file(s) known to git.` – lawlist May 05 '13 at 04:03
  • Well I'm not going to clone the repo myself, but my guess is that a shallow clone (i.e. using the `--depth` argument) may not be compatible with subsequently checking out another branch. You could try adding `-b aquamacs24` to the clone command. – phils May 05 '13 at 05:09
  • The -b option yields a similar error message as trying to checkout aquamacs24 with the master of 1.58 GB -- i.e., `git checkout -b aquamacs24. M lisp/international/uni-category.el; M lisp/international/uni-old-name.el; Switched to a new branch 'aquamacs24'`. When checking out on the 1.58 GB master, the message indicated that the files had changed and that they needed to be pushed or stowed away . . . . – lawlist May 05 '13 at 05:21
  • I suggested using `-b` with `git clone`, not with `git checkout`. e.g. `git clone --depth 3 -b aquamacs24 git://github.com/davidswelt/aquamacs-emacs.git`. – phils May 05 '13 at 06:20
  • Your solution with -b option appears to download the full 1.58 GB master, however, the checkout option works once that download is complete. I'll continue to search for a terminal command-line solution that is the equivalent of the 182.5 MB ZIP option https://github.com/davidswelt/aquamacs-emacs/tree/aquamacs24 I'll post a follow-up once I find it. Thank you very much for having taken the time to steer me in the right direction. – lawlist May 05 '13 at 18:07
  • With `--depth` I'm surprised that it downloads the whole repo (I rather thought that was the main point of having that argument, and the brief test I did with depth 1 was showing 5% when I stopped it after 10MB, which seemed to match up well with your ~180MB indication); however that's everything I can think of. Unless you don't actually want any kind of working copy of the repo at all, in which case you can just use `wget` or `curl` to fetch the zip file. – phils May 05 '13 at 21:43
  • Part of my problem stems from a misunderstanding of how to browse a branch using the terminal, or how to separate a branch into an entirely new folder that I can then browse. GitHub.app for OSX does not permit browsing a branch. However, I just installed Tower.app and that does permit browsing and also exporting -- I exported Aquamacs24 to a temporary directory and synchronized / compared files to the ZIP download option referred to above. Low and behold the files are exact in size / date, with the only difference being .git folder existing in the cloned local. – lawlist May 06 '13 at 16:07
  • git clone git@github.com:davidswelt/aquamacs-emacs.git --branch aquamacs24 --single-branch /path/to/local/folder – lawlist May 06 '13 at 18:37
  • The above-terminal command line appears to be what I've been looking -- the extra files 1.38GB are all in the `.git` folder. I do not believe those are used during the build process for making the application. – lawlist May 06 '13 at 18:42
  • That's the git 1.7.10 solution I linked to in my answer :) Everything in the .git folder is revision history for the repository. It's still large because ultimately the history of the single branch you're interested in can be traced back to much older ancestors, and all that history is present. (Again, if you *don't* actually want the revision history, you probably shouldn't be cloning the repository at all, but I'm still unclear about what you want to do with the files.) – phils May 06 '13 at 22:10
  • Yes, I think that is my issue also .. I really don't know why I am cloning except that all the documentation readily available on the internet about building Aquamacs from source instructs the use of git cloning. The goal is to get the bleeding edge Acuamacs24 source files so that I can make my own custom build with NSSpellChecker for OSX, but not the other Aquamacs stuff like strange (out of the way) user file locations that are hard-coded into the executable during the build process. The ZIP archive worked for the build, but I needed to verify it was the same as git clone single branch. – lawlist May 07 '13 at 00:47
  • Thank you very much for your help -- greatly appreciated. I had previously spent an enormous amount of time trying to build from source with the master (and failing), and it's been quite a journey learning the difference between the master and the branch and how to get from point A to point B. – lawlist May 07 '13 at 00:58