Few basic commands you must have to know before getting to Git. I assume, you already familiar with it as you are playing with Git right now, Or you can give a try.
How to create repository in Bitbucket?
- To create a repository, log in to the Bitbucket and click on the (+) button left of the home page to create a repository.
- You’ll get a page to create a 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 into the terminal. (Use SSH)
Nice! You’re almost done!
- A folder has been created your desktop( the 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 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 just starts up! Now, read few docs to know a 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 commands can be found on google as well.
Next up: I’ll write about the basics of learning the command lines and get used to it next.