Welcome to your personal sandbox, you can’t really break anything so feel free to go a bit crazy. We’ve created a couple basic tasks to get you started. Try them both, or just play in your sandbox to get acquainted with Bitbucket.
You can complete the following tasks with either SourceTree (Atlassian’s Git and Mercurial client) or using the command line from Linux or OSX. Or use the BASH command line tools for Windows.
While it's true you cannot really break anything in the bucket-o-sand you should keep the following in mind:
- We designed this as a practice repo to help you get acquainted with Bitbucket.
- At this point we've not designed this tutorial to include pull requests to the source repository, we usually close them with a note thanking you for your time.
- This repository is usually a fork of a source repository. For this reason, when you are ready to start coding you will likely want to create an entirely new repo to use for your project.
Happy coding!
###TASK 1. Clone the repository to your local machine
Cloning copies the repository to your local system.
-
Click the Clone in SourceTree icon, a down arrow, near the top of the page, then click Clone in SourceTree.
- A Launch application window opens.
-
Select SourceTree, if it is not already selected, and click OK.
- SourceTree may ask for your password several times.
-
Review the information in the Clone new tab. Notice the Destination Path is where you will clone your repository.
-
Click Clone
SourceTree clones your repository from Bitbucket to your local machine and will open to the new repository.
Learn the Git basics of stage, commit, push when you make a change to the 'sample.html' file.
-
Double-click on your tutorial repo.
-
Select Working Copy from the left hand navigation.
-
Select Show All from the list above
SourceTree shows the files in the working tree.
-
Select the sample.html file and do one of the following: *For Mac press 'control + click' and select Show In Finder *For Windows right click and select Show in Explorer
-
Using your favorite editor, edit the
sample.html
file. -
Change the heading from
My First File
toPlaying in the Sand
. -
Save and close the file.
-
Return to SourceTree.
SourceTree changes the file's icon to modified.
-
Select the 'sample.html' file and drag it into Staged Files area.
-
Click Commit.
-
Enter a commit message.
-
Press Commit.
-
Click Push to send your changes to Bitbucket.
-
Click Commits, in Bitbucket, to view your change.
Using the command line from Linux, OSX or GitBash for Windows.
Cloning makes a local copy of the repository for you.
-
Click the Clone button in Bitbucket.
-
Make sure the protocol is set to HTTPS.
Bitbucket pre-fills the clone command for you.
-
Copy the command.
-
Open a terminal, or launch a GitBash terminal, on your local machine.
-
Navigate to the directory where you want your files.
-
Paste the command at the prompt.
-
Press ENTER on your keyboard.
Git clones your repository from Bitbucket to your local machine.
If you have trouble cloning from these instructions you can check out the more detailed tutorial.
Learn the Git basics of stage, commit, push when you make a change to the 'sample.html' file.
-
Go to your terminal window and navigate to the repository root.
-
Using your favorite editor, edit the
sample.html
file. -
Change the heading from
My First File
toPlaying in the Sand
. -
Save and close the file.
-
Stage the file with Git.
git add sample.html
-
Commit the change.
git commit -m "changing sample.html"
-
Push to Bitbucket.
git push
The system prompts you for a username/password.
-
Enter your Bitbucket account name and the password.
-
After the push completes, click Commits, in Bitbucket, to view your change.