I am taking a git class and am using a flavor of debian on my chromebook for the command line portion. We just learned the "switch" command, and it seems my version of git for whatever reason does not have this command.
I know I can use "checkout" but it seems like "switch" is better and more intuitive to use. I can't find anything on the git docs or by researching to get this command in my version of git.
I'd also like to note that if I try to update git, I get a message that says "git is already the newest version"
CodePudding user response:
Chromebook Linux uses a google-maintained repository1 for doing apt
updates: see this question and its answers for details. This particular apt repository has an old version of Git as its latest, so in that sense, your Git is the latest Git-for-Chromebook. It's just not the latest Git.
This question is therefore really about how to update your Chromebook to a later version of Linux (and/or certain user commands on Linux) than that supported by Google. That's off-topic for StackOverflow; sites like ubuntu.com (which recommends using Crouton) or askubuntu.com (which as you can see also recommends that) provide clues here. It looks like at this point you actually already have some flavor of Ubuntu Linux installed, though I do not have or use a Chromebook so I'm just guessing here.
Once you're at that stage, this question on unix.stackexchange.com describes how to get more up to date than whatever distribution you're using. You can also download and build Git from source, using Git to clone any of the existing Git repository1 clones, such as the one on GitHub. A full build from source is nontrivial because you need a lot of supporting packages, although it's also not that difficult (you just run a lot of apt install
s).
1The word repository has multiple meanings here. It can refer to an APT repository or Personal Package Archive ("PPA"), or a Git repository. In this case, where I've attached this footnote, I have used both meanings.
CodePudding user response:
The switch
command was added in Git v2.23. The version of Git that is used on your Chromebook is likely older than that. You can check the version with git --version
.