GIT setup

For MacOS

There are several options for installing Git on macOS. Note that any non-source distributions are provided by third parties, and may not be up to date with the latest source release.

  • Homebrew

Install homebrew if you don't already have it, then:

$ brew install git

  • MacPorts
  • Install MacPorts if you don't already have it, then:

    $ sudo port install git
  • Xcode

Apple ships a binary package of Git with Xcode.

  • Binary installer

Tim Harper provides an installer for Git. The latest version is 2.33.0 , which was released over 2 years ago, on 2021-08-30.

  • Building from Source

If you prefer to build from source, you can find tarballs on kernel.org. The latest version is 2.45.0.

For Windows

Click here to download the latest (2.45.0) 32-bit version of Git for Windows. This is the most recent maintained build. It was released 9 days ago, on 2024-04-29.

Other Git for Windows downloads

  • Standalone Installer

32-bit Git for Windows Setup.

64-bit Git for Windows Setup.

  • Portable ("thumbdrive edition")

32-bit Git for Windows Portable.

64-bit Git for Windows Portable.

  • Using winget tool

Install winget tool if you don't already have it, then type this command in command prompt or Powershell.

winget install --id Git.Git -e --source winget

The current source code release is version 2.45.0. If you want the newer version, you can build it from the source code.

For Linux and Unix

It is easiest to install Git on Linux using the preferred package manager of your Linux distribution. If you prefer to build from source, you can find tarballs on kernel.org. The latest version is 2.45.0.

  • Debian/Ubuntu

For the latest stable version for your release of Debian/Ubuntu

# apt-get install git

For Ubuntu, this PPA provides the latest stable upstream Git version

# add-apt-repository ppa:git-core/ppa # apt update; apt install git

  • Fedora

# yum install git (up to Fedora 21)

# dnf install git (Fedora 22 and later)

  • Gentoo

# emerge --ask --verbose dev-vcs/git

  • Arch Linux

# pacman -S git

  • openSUSE

# zypper install git

  • Mageia

# urpmi git

  • Nix/NixOS

# nix-env -i git

  • FreeBSD

# pkg install git

# pkgutil -i git

  • Solaris 11 Express

# pkg install developer/versioning/git

  • OpenBSD

# pkg_add git

  • Alpine

$ apk add git

Red Hat Enterprise Linux, Oracle Linux, CentOS, Scientific Linux, et al.

RHEL and derivatives typically ship older versions of git. You can download a tarball and build from source, or use a 3rd-party repository such as the IUS Community Project to obtain a more recent version of git.

  • Slitaz

$ tazpkg get-install git

Make sure to have Git installed globally & running on your computer. If you already have installed git on your computer, you can skip this step.

Command Description
flutter clean This command deletes build-cache which is in the /build folder.
git add - “git add .” stages new files and modifications, without deletions (on the current directory and its subdirectories) - “git add -A” stages all changes - git add -u” stages modifications and deletions, without new files
git commit -m "your commit changes" This command will create a commit with the changes you staged using git add and associate the commit message ("Added new feature X") with those changes in the version history of the repository.
git push The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo