Skip to content

Git setup guide for macOS and introduction on how to use it

Notifications You must be signed in to change notification settings

c-rack/first-steps-with-git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

first-steps-with-git

Git setup guide for macOS and introduction on how to use it

This is just a basic collection of tasks that I perform on a new machine. For more, read the git documentation.

Recommended tools

Installation

Just type brew install git in the terminal.

Configuration

Configure email and name:

git config --global user.name "John Doe"
git config --global user.email [email protected]

Change default pull behavior

git config --global pull.rebase true

Configure a better git log:

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

Enable signed commits (you need to git commit -S to sign the commit with your key)

git config --global gpg.format ssh
git config --global user.signingKey ~/.ssh/id_rsa.pub

Enable safe force pushing

git config --global alias.fpush push --force-with-lease

Enable reuse recorded resolution

git config --global rerere.enabled true
git config --global rerere.autoUpdate true

Make sure git push commands are performing the correct compression

git config --global pack.usePathWalk true

Maintenance

In each repository, enable the automatic git maintenance

git maintenance start

About

Git setup guide for macOS and introduction on how to use it

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published