How to create git repository in Ubuntu ?

1.The git version control system can be installed with the this command:

$sudo apt-get
$install git

2.If you are using Git first time, you need to introduce yourself to git by following commands:

$git config --global user.email "[email protected]"
$git config --globaluser.name "Your Name"

3.To create repository you need to initiate repository at a particular folder by below command:

$git init --bare /path/to/repository

4.Now go to that folder and edit some file and commit the changes by following commands:

$cd /path/to/repository
$git commit -a
# Commit all changes to the local version of the repository
$git push origin master
# Push changes to the server's version of the repository

5.Now, to see who changed what, pass below command:

$git log

and you will see all changes that have made till now including changes you have just made.

Leave a Reply

Your email address will not be published.