Posted under » Version Control updated on on 23 Jul 2026
You must install git first but if you are running Ubuntu server GIT is already pre-installed. To be sure check it out by
$ git --version // 2.43 as of 2026
Create a directory and cd inside the directory.
$ git init $ git add README.md
Just like SVN you can do this when commiting.
$ git commit -m "this is my commit message"
Since Git is about working with other people, create your profile.
$ git config --global user.name "Hanafi" $ git config --global user.email lkyb@anoneh.com
Next, tell Git to take a snapshot of the contents of all files under the current directory (note the .), with git add:
$ git add .
This snapshot is now stored in a temporary staging area which Git calls the "index". You can permanently store the contents of the index in the repository with git commit.
$ git commit
This will prompt you for a commit message. Press ^s to save and then exit. You’ve now stored the first version of your project in Git. However, if you prefer to use Vim instead of nano editor.
$ git config --global core.editor vim
Read adding a new SSH key to your GitHub account then Adding files to Github with push and Push to github.