Skip to content

Burak Ömür: Git as a version management system

Burak Ömür edited this page Feb 16, 2020 · 2 revisions

What is version control system?

  • Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later. In example, after doing some errors in code or wiki changes in a page, you can take back the changes you have done later by looking it in detail. There are many version control systems today.

Git

Git is a distributed version control system where users can make changes. It uses command line and with git it’s easy to undo changes back and forth with a precise explanation of the changes that are made.

Some Other Key Concepts

Let’s try to understand some key terminologies over here:

  • Commit: When you make your changes, the changes should be saved in the local repository before it is being sent to staging area/staging Index and later remote repository. This saves your code into Git. If you want to know more about commit, please check this link git commit.
  • Checkout: When content in the repository has been copied to the working directory.
  • SHA (Secure Hash Algorithm) : A unique ID given to each commit.
  • Branch: When you diverge from the main line of development and continue to do work without messing with the main development line.

Conclusion

Git is an open source tool that empowers individuals or groups that work on a detailed project. Each user's commit contains the name of it, the description of the commit. Git is useful in cases where a team is working from remote areas. Since, any individual can make changes provided the access is given for the remote repository.

Essential git commands

  • git config

    • Utility : To set your user name and email in the main configuration file.
  • git init

    • Utility : To initialise a git repository for a new or existing project.
  • git clone

    • Utility : To copy a git repository from remote source, also sets the remote to original source so that you can pull again.
  • git status

    • Utility : To check the status of files you’ve changed in your working directory, i.e, what all has changed since your last commit.
  • git add

    • Utility : adds changes to stage/index in your working directory.
  • git commit

    • Utility : commits your changes and sets it to new commit object for your remote.
  • git push/git pull

    • Utility : Push or Pull your changes to remote. If you have added and committed your changes and you want to push them. Or if your remote has updated and you want those latest changes.
  • git branch

    • Utility : Lists out all the branches.
  • git checkout

    • Utility : Switch to different branches
  • git stash

    • Utility : Save changes that you don’t want to commit immediately.
  • git merge

    • Utility : Merge two branches you were working on.
  • git reset

    • Utility : You know when you commit changes that are not complete, this sets your index to the latest commit that you want to work on with.
  • git remote

    • Utility : To check what remote/source you have or add a new remote.

References









Clone this wiki locally