- #GIT ON MAC OS INSTALL#
- #GIT ON MAC OS UPGRADE#
- #GIT ON MAC OS FULL#
- #GIT ON MAC OS SOFTWARE#
- #GIT ON MAC OS CODE#
And I am assuming consumer usage doesn't typically call the slow-er filesystem APIs like a single git merge (with many changed files) or git status would. I'm not sure that even makes sense for their business, as I'd guess they chose this tradeoff to better server their primary customer-the consumer. I've filed a bug with Apple, however, this is probably deep and internal with APFS and I have no expectation of it being fixed or worked on by Apple. It appears that lstat requires a global lock per thread within APFS and no matter what one does, one will be held back by at least a factor of ten for large IO operations versus linux.
#GIT ON MAC OS FULL#
That said, I'm running my terminal through the x86 emulation mode and still get full real times in the ~.06s range, 10-20x slower than my old 'nix machine with RHEL 8.3 and with a slightly older version of Git than the mac (2.30.1 vs 2.27.0 ). I received a 20% or so speedup by removing brew's updated git and using the system default. And it was even sluggish on tiny git repos with less than 100 files, so either something was seriously wrong with my filesystem-which should've shown problems elsewhere-or Git was being funny. Later in the day when I was doing some heavy Git activity, I noticed everything felt.
#GIT ON MAC OS UPGRADE#
But as Apple's evolved macOS, they've done a pretty good job of keeping the system versions relatively up-to-date, and unless you need bleeding edge features, the version of Git that's installed on macOS Mojave (2.17.x) is probably adequate for now.īut back to Homebrew-recently I ran brew upgrade to upgrade a bunch of packages, and it happened to upgrade Git to 2.20.1. In the past, it was necessary to use Homebrew to get a much newer version of Git than was available at the time on macOS.
#GIT ON MAC OS SOFTWARE#
I regularly use Homebrew to switch to more recent versions of CLI utilities and other packages I use in my day-to-day software and infrastructure development. Maybe some of the 'spyware-ish' software that's installed on the work mark is making calls like lstat() super slow? Looks like I might be profiling some things on that machine anyways :)
$ git config -global : I just upgraded my personal mac to 2.20.1, and am experiencing none of the slowdown I had on my work Mac. Setting up Sublime Text as the Git Mergetool $ git config -global "subl -w \$MERGED" $ git config -global core.excludesfile ~/.gitignore DS_Store files in your Git repositories, you can configure your Git to globally exclude those files: # specify a global exclusion list DS_Store (a hidden OS X system file that's put in folders) to your. On a Mac, it is important to remember to add. Third, Add your keys to GitHub by going into account settings. Please use a strong passphrase for your keys. # Enter file in which to save the key (/Users/you/.ssh/id_rsa): # Generating public/private rsa key pair. $ ssh-keygen -t rsa -C Creates a new ssh key, using the provided email as a label The default settings are preferred, so when you're asked to "enter a file in which to save the key,"" just press enter to continue. Second, To generate a new SSH key, copy and paste the text below, making sure to substitute in your email. If you don't have either of those files go to step 2. To see the path of the given executable that is executed, run the command which git as shown below. Open up your Terminal and type: $ cd ~/.sshĬheck the directory listing to see if you have files named either id_rsa.pub or id_dsa.pub. To uninstall Git, run the command below on macOS: If you installed Git on your device via the official Git instruction guide, This means Git was installed to the following path: /usr/local/bin/git.
Most of the instructions below are referenced from here.įirst, we need to check for existing SSH keys on your computer. This might be difficult to configure in case you have two factor authentication enabled. So you don't have to type your username and password everytime, let's enable Git password caching as described here: $ git config -global credential.helper osxkeychain
#GIT ON MAC OS CODE#
To push code to your GitHub repositories, we're going to use the recommended HTTPS method (versus SSH). $ git config -global user.email will get added to your. Next, we'll define your Git user (should be the same name and email you use for GitHub): $ git config -global user.name "Your Name Here"
When done, to test that it installed fine you can run: $ git -versionĪnd $ which git should output /usr/local/bin/git.
#GIT ON MAC OS INSTALL#
What's a developer without Git? To install, simply run: $ brew install git