Git for version control
What
is version control ?
Version
control systems are a category of software tools that help a software team
manage changes to source code over time. Version control software keeps track
of every modification to the code in a special kind of database. If a mistake
is made, developers can turn back the clock and compare earlier versions of the
code to help fix the mistake while minimizing disruption to all team members.
Software developers working in teams
are continually writing new source code and changing existing source code. The
code for a project, app or software component is typically organized in a
folder structure or "file tree". One developer on the team may be
working on a new feature while another developer fixes an unrelated bug by
changing code, each developer may make their changes in several parts of the
file tree.
Version control helps teams
solve these kinds of problems, tracking every individual change by each
contributor and helping prevent concurrent work from conflicting. Changes made
in one part of the software can be incompatible with those made by another
developer working at the same time. This problem should be discovered and
solved in an orderly manner without blocking the work of the rest of the team.
Further, in all software development, any change can introduce new bugs on its
own and new software can't be trusted until it's tested. So testing and
development proceed together until a new version is ready.
Install Git on Windows
Git for Windows stand-alone installer
- Download the latest Git for Windows installer.
- When you've successfully started the installer, you should see the Git Setup wizard screen. Follow the Next and Finish prompts to complete the installation. The default options are pretty sensible for most users.
- Open a Command Prompt (or Git Bash if during installation you elected not to use Git from the Windows Command Prompt).
- Run the following commands to configure your Git username and
email using the following commands, replacing Emma's name with your own.
These details will be associated with any commits that you create:
$ git config --global user.name "git user" $ git config --global user.email "gituser@company.com"
- Optional: Install the Git credential helper on Windows
Bitbucket supports pushing and pulling over HTTP to your remote Git repositories on Bitbucket. Every time you interact with the remote repository, you must supply a username/password combination. You can store these credentials, instead of supplying the combination every time, with the Git Credential Manager for Windows.
Install Git with Atlassian Sourcetree
Sourcetree, a free visual Git client for Windows, comes with its own bundled version of Git. You can download Sourcetree here.
Install Git on Linux
Ubuntu (apt-get)
Git packages are available via apt:
- From your shell, install Git using apt-get:
$ sudo apt-get update $ sudo apt-get install git
- Verify the installation was successful by typing
git --version
:$ git --version git version 2.9.2
- Configure your Git username and email using the following
commands, replacing Emma's name with your own. These details will be
associated with any commits that you create:
$ git config --global user.name "Git User" $ git config --global user.email "gituser@company.com"
Git Commands
Comments
Post a Comment