Skip to content

Hasan Ramazan Yurt Git Research

Hasan Ramazan Yurt edited this page Feb 17, 2020 · 1 revision

What is Git and why programmers use it?

Git is a distributed version control or management system. What a version control system is will be explained later in the research. Git is used to track changes in the source code of any sofware project. It is designed to ensure coordination between programmers that study for the same project. Basically Git has a directory that isa full-fledged repository with complete history and full version-tracking abilities in every computer. It is independent from network connection.

What is version control system?

A version control system is a codebase tracking system that includes full history of a project. Due to version control system every developer in the project can see the project, history, and version in their development area. This provides automatic management, branching and merging. Thanks to this system, working with the same project on different computer become very fast and easy. Also, the ability to working offline is improved.

Here is an image that show distributed control system mechanism: dist-cont-mech

Git Terms

  • Checkout: It is the term to explain switching branches in a repository.
  • Clone: A clone is a copy of a repository or the action of copying a repository.
  • Fetch: By using fetch, one can download and copy a branch’s files to his/her workstation.
  • Merge: Takes changes from one branch and merges it to other brach.
  • Push: Updates a remote branch with the commits made to the current branch.
  • Pull: If someone has changed code on a separate branch of a project and wants it to be reviewed to add to the master branch, that someone can put in a pull request.

Basic Git Commands

  • git config Tell Git who you are
  • git init Create a new local repository
  • git clone Check out a repository
  • git add Add one or more files to staging (index)
  • git commit Commit changes
  • git push Send changes to the master branch of your remote repository
  • git status List the files you've changed and those you still need to add or commit
  • git remote Connect to a remote repository
  • git branch List all the branches in your repo, and also tell you what branch you're currently in
  • git checkout Create a new branch and switch to it
  • git pull Fetch and merge changes on the remote server to your working directory

References









Clone this wiki locally