My Experiences with GIT

This article is also available in the following file :  git

1. Starting with git
Steps to add files to repository:
1. Create your repository on git.
2. Create your pair of SSH keys and add them to the git website.
3. To add your files :
(a) git add LDAP.tar.gz
(b) git commit -m ’Adding Source Code’ -m follows a custom message.
(c) git push origin master
These steps are well documented at :
http://help.github.com/linux-key-setup/
http://sirupsen.com/starting-with-git/
The reader is adviced to refer the above links for this section.

2. Deleting items from your repository
To delete items from your repository:

git rm LDAP.tar.gz

git commit -m ’Removing Source Code’ -m follows a custom message.

git push origin master

Figure 1 shows screenshot of my repository which has the file LDAP.tar.gz. Figure 2 shows the steps to delete the file from the remote repository.
3. Updating your repository
Many a times it happens that your local copy and your remote repository are not in sync with each other. In that case, I got an error which said,

Merge the remote changes before pushing again.
See the ’Note about fast-forwards’ section of ’git push –help’ for details.

The solution for this is :

git merge origin/master

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: