Interfaces to Git - PADOH-DHI/contributor-guide GitHub Wiki

There are three primary ways to work with a repository hosted on GitHub: on the GitHub website, using the Git GUI, or using command-line Git.

GitHub website

Using GitHub's online menus is the most direct way to contribute to a repository. With it, you can

  • Create repositories
  • Add new files
  • Upload changed files
  • Create branches
  • Submit and accept pull requests
  • Fork projects

This doesn't cover all features in Git. Notably, GitHub's interface doesn't actually allow grouping changes in multiple files into a single commit. The same result can be done by creating a branch, adding the files to it, and then merging the branch back and "squashing" the multiple commits into one.

One GitHub feature, forking, is not part of Git. It's a way to work on and contribute to projects you're not allowed to push to.

GitHub Desktop

This requires downloading and installing the software.

This is a free graphic user interface (GUI) to git produced by GitHub. It's specifically designed to manage local repositories connected to remote repositories. It shows pending changes to files, a list of local repositories, and a graphic depicting the repository's branches. A "sync" button also makes it easy to get the "up-to-date" version of files from the remote repository.

Git GUI

This interface requires having the Git software installed.

The GUI that comes with Git covers the basics. It allows you to work independently on your local computer, committing to your own copy of the repository. When the work is ready to be added to the shared repository, you can push your changes.

In the GUI, a list of changed files is shown, and clicking anything on the list will show its changes line by line. You can then choose to add or omit files from a commit. The GUI menu bar also allows you to fetch, push, and create branches. Notably

Git command line

This requires having the Git software installed.

The command-line interface (CLI) is the original interface to Git, and the only one that is sure to include all of the software's functionality. It is highly suggested you use Git Bash instead of the Windows command prompt.

The bash interface also includes tools in addition to Git, such as grep,

The number of features in Git can be intimidating, but you'll only use a handful of them in day-to-day work:

  • git pull
  • git checkout
  • git add
  • git commit
  • git push
  • git help