Tutorial three: How to set up a git repository?

03:47:00 0 Comments A + a -

Local git repository:


             Setting up a local repository is pretty simple. By local repository I mean making your project a git repo on your work-station.  

            Open git-bash. Navigate to your project folder. In my case it is \android-test.

  Sowmya\android-test$ git init                                                     


Syncing with a remote repository:

Now your project is a git repository. if you want to upload it to a remote repository, create a repository for your project on github or bitbucket. In my case it is a github repo. Get the https or SSH link to the repository.

  $ git remote add origin git@github.com:username/yourreponame.git                  

If you have cloned a repository using git clone the repository already has the link to the remote repo, so you can skip the previous step.

To index all your changes,

  $ git add .                                                                       


Commit your changes with an appropriate commit message.

  $ git commit -m "Initial commit"                                                  

Issue command push when your ready to push your changes to the remote repository.

  $ git push -u origin master                                                       

 You might need to provide your github credentials and once authenticated your repos will be pushed to your online repsoitory.

Got a question? Leave a comment.

Android Developer, Tech Enthusiast, Startup Aficionado, Seeker of Happiness.