Git resources

UsinGit is a site where beginners can learn Git using examples and tutorials

GIT commands you need to know



Creation of a new repository: git init

Basic usage

This command initializes a new Git repository in the current directory:

git init

Advanced usage

If you need to init a repository in a specific directory, just ad the directory name as an argument:

git init your-new-project-directory


Cloning a repository: git clone

Basic usage

Clones a repository from an URL into a new folder on a local computer.

git clone https://github.com/example/repo.git

Advanced usage

You can clone a specific branch, e.g. a dev branch:

git clone git@github.com:example/repo.git -b dev


Displaying status of files: git status

Basic usage

Displays status of the files in the repository - which are staged, unstaged, or untracked.

git status



What is Git?

Git is one of the most popular source-control management systems, which is used mainly in software development. Its main purpose is to allow software developers to track code changes, collaborate on projects, and manage multiple versions of code.

History of Git

Git was created in 2005 by Linusem Torvalds, the author of Linux. Torvalds needed an effectiv tool to manage versions of code.

Basic terms

  • Repository

    Storage, where the whole project resides, including all its versions and changes.
  • Commit

    Record of changes in repository. Every commit includes description of changes, date and time, and author.
  • Branch

    Parallel version of the project. It is a named pointer to a commit
  • Merge

    Merge of the changes from one branch to another.
  • Clone

    Copy of the repository in a local computer, which you can edit and then sync with a remote repository (commit).

How Git works?

Git uses distributed model, which means that every developer has his own copy of the data on his local computer. It allows the developer to work indepedently on a network conection.

Conclusion

Git is now an industry standardfor source control management, thanks to its performance and flexibility. Whether you work on a small project, or a large open-source one, Git will provide you functionality required for effective code management and collaboration.