Github and SmartGit   1 comment

In this post I will explain how to create a new Github repo and use it with SmartGit as a client.

  1. Navigate to https://github.com/ and click on the icon for ‘Create a Repository’

Create Repo

2. If you don’t have an account you will be asked to create an account. Create one or log in and you will come to this page

GitPage

3. Note down the URL on top of the window for eg. ‘https://github.com/salilsurendran/personal’. Open SmartGit client and select the option ‘Clone Existing Repo’. In the next page enter this url

SmartGitRepo

4. Click next and select a local directory for eg. C:\Git\personal into which the remote repo will be cloned. Since there are no files in the remote repo your local repo will be blank.

5. Next create a new Eclipse project and point the workspace to C:\Git\personal so that you could upload files to the newly created repo. As soon as the project is created you will files in the SmartGit window. Most of these files we don’t need in the repo. So we will go ahead tell SmartGit to ignore them. Select all these files and right click and click ignore. These files will disappear from the window and SmartGit will not consider them for upload or note changes in them.

SmartGitDir

6. Next create a simple project in Eclipse and make sure that the source folder is pointing to you C:\Git\personal. Add some simple java files. Your Github window will now look like this(Note : Feel free to ignore any of the eclipse files or .gitignore files added). You are now ready to upload all files to the remote repo.

SmartGitProject

7. Select the uppermost node and click on the ‘Commit’ button on the taskbar.

Node

8. You will come to dialog box like this. Select the files you want to commit, enter a commit and click on ‘Commit and Push’. Enter the username/password you created for the remote repo in Step 2. These files will disappear from the right hand side window of SmartGit. Don’t worry those files have not been deleted it is just that SmartGit doesn’t show files that are not out of sync with the remote repo.CommitWindow

9. Next go to the intial url of the remote repo https://github.com/salilsurendran/personal in your browser. You will see the files uploaded . Congrats you have successfully created your first repo and uploaded files to it.

Final

Advertisements

Posted January 5, 2013 by salilsurendran in Technology

Tagged with , , ,

One response to “Github and SmartGit

Subscribe to comments with RSS.

  1. This was very useful, you save me a lot of time.

    Thanks a lot,

    -Marco.

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: