Well, before getting to Git, few basic git command you must have to know. As you are playing with git right now, I assume, you are already familiar with it. Or you can give a try.

How to create repository in Bitbucket?

  • To create a repository, login to the Bitbucket and click on the (+) button left of the home page to create a repository.

How to create bitbucket account

  • You’ll get a page to create repository. Put your repo name as you want.
  • Keep the access level ‘private repository’ box checked unless you want to make your repo public that everyone can see.
  • Click on ‘Create repository’ and you are done to create a repository!

How to create new repository in bitbucket

Now, you have to clone your repository to your local system.

  • Open your terminal and command cd desktop to open your desktop directory(You may choose your own directory)

Using git in command line

  • On the overview of your repository, copy the clone code and paste it in the terminal. (Use SSH)

How to clone git repository

Nice! You’re almost done!

  • A folder has been created your desktop(directory that you’ve chosen). This is your local folder where all the files will be stored.

Now what to do after adding files in this local folder? Well, you have to put your local file(s) to bitbucket.

  • Open your terminal window and enter to the folder that you have cloned from bitbucket.

useful git command

  • Now check what you have made changes and added files to this folder. Type: git status to see the changes.

How to know git status

Well, here i’ve added a file to the folder and now i’ve to add this file to git and commit it.

Type: git add locations.txt and after adding this, type- git commit -m ‘comment’

git location command

git location

You may add & commit multiple changes but finally you must have to send them all to bitbucket. Just type git push or git push origin master/develop.

 

This is just starts up! Now, read few docs to know little bit more to about the git commands. You can follow the official guide from atlassian to learn and practice them.

 

Useful Git Commands:

Please follow the links below to know some basic but useful git commands. Plenty of command can be found in google as well.

 

Next up: I’ll write about the basics of learning the command lines and get used to it next.