Git: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
Wrote article on Git
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1:
'''Git''' is an open source [[W:Version Control System|Version Control System]] made by Linus Torvalds in 2005. It is one of the most well known and popular among version control systems.
 
== Information ==
Oftentimes when working on a hobby operating system, files end up being lost or broken, and having a backup of an older version is useful. Git (not to be confused with [[GithubW:GitHub|GitHub]]) is a [[Version Control System]], which can be used to push backups of a version of a project (known as a repository, or "repo") to a remote server. This can be a private repository, or a public repository to share work with other developers, in the case of many [https[W://en.wikipedia.org/wiki/Open-source_softwaresource software|open source]] projects.
 
== Features ==
Line 8:
 
== History ==
Git was initially developed in 2005 by [https[W://en.wikipedia.org/wiki/Linus_TorvaldsLinus Torvalds|Linus Torvalds]] as a side project to help him develop the [[Linux]] kernel, as a replacement for another closed source Version Control System that he was using at the time, [https[W://en.wikipedia.org/wiki/BitKeeper |BitKeeper]], after Linux was revoked access to the service. On the 26th of July, 2005, Torvalds turned over Git's maintenance to [https[W://simple.wikipedia.org/wiki/Junio_HamanoJunio Hamano|Junio Hamano]].
 
== Git vs. GitHub ==
[https[W://github.com GitHub|GitHub]], a closed source website owned by Microsoft, owns remote servers powered by the Git, allowing developers to host their remote repositories on GitHub's servers rather than their own. While closed source, GitHub has had a massive impact on the open source community that should still be recognised. GitHub also provides a web interface to browse files of a repository.
 
It's a common mistake for developers new to Git (and programming in general) to not understand the difference between Git and GitHub, however the difference should be recognised.
Line 20:
Firstly, cloning a repository, which is basically downloading a remote repository to your own machine. To do so, run the following command in your terminal:<syntaxhighlight lang="bash">
git clone [URL of repository]
</syntaxhighlight>To push updates made from a local machine to a remote repository, there are three commands needed. You must be in the directory of the project to run these. Firstly, you must stage all changes made to the repository:<syntaxhighlight lang="bash">
git add .
</syntaxhighlight>Now, you can make a commit message, which is a short single-line comment on the changes made. Often repositories will have a specific structure for commit messages that you must adhere to. To do so, run:<syntaxhighlight lang="bash">
git commit -m "[COMMIT MESSAGE]"
</syntaxhighlight>Finally, push the updates to the remote repository:<syntaxhighlight lang="bash">
git push
</syntaxhighlight>Note that these instructions expect that you created the repository. There will be additional steps such as forking the repository and making a pull request when you are contributing to somebody else's repository. This also expects that you are pushing to the main branch.
 
== See also ==
* [https[W://en.wikipedia.org/wiki/Git |Wikipedia Article on Git]]
* [https://git-scm.com/ Git Homepage]
* [https[W://en.wikipedia.org/wiki/Linus_TorvaldsLinus Torvalds|Wikipedia Article on Linus Torvalds]]
 
[[Category:Tools]]