In the following article we are going to explain to you how to install and set-up GIT on an Ubuntu 14.04 VPS.
What is GIT?
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.
UPDATE THE SYSTEM
Before installing and setting up GIT, make sure your Ubuntu Linux VPS is fully up to date by using the following commands:
## apt-get update ## apt-get upgrade
INSTALL GIT USING APT
The best and fastest way to install GIT on your Ubuntu 14.04 VPS, is to use
apt as in:
## apt-get install git-core
Once GIT is installed on your linux server, you may want to configure it using
git config or its configuration file
.gitconfig, though it is not required as GIT will work with no-configuration by default. Anyway, let’s set-up some GIT parameters using
## git config --global user.name "My Name" ## git config --global user.email firstname.lastname@example.org
## git config --global core.editor vim
Set-up Diff tool
## git config --global merge.tool vimdiff
Display GIT Configuration
## git config --list
to learn more about
git config, refer to its man page.
CREATE GIT REPOSITORY
You can easily create a GIT repository on your linux virtual server using something like this:
## mkdir -p /repos/my-git-project ## cd /repos/my-git-project ## git init --bare
WORK WITH GIT REPOSITORY
Now, clone the repository you just created, add a sample
README file, commit your changes and perform a push request using:
## cd /home ## git clone ssh://email@example.com/repos/my-git-project ## cd my-git-project ## echo test > README ## git add README ## git commit -m "Initial commit. Adding README file" ## git push origin master
COMMON GIT COMMANDS
changed files in your working repository
## git status
show all git commits
## git log
made changes to tracked files
## git diff
list all branches
## git branch
try searching the Internet to find out more
git usage examples.
Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install GIT for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.