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.
- 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!
Now, you have to clone your repository to your local system.
- Open your terminal and command
cd desktopto open your desktop directory(You may choose your own directory)
- On the overview of your repository, copy the clone code and paste it in the terminal. (Use SSH)
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.
- Now check what you have made changes and added files to this folder. Type:
git statusto see the changes.
Well, here i’ve added a file to the folder and now i’ve to add this file to git and commit it.
git add locations.txt and after adding this, type-
git commit -m ‘comment’
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.