-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.text
107 lines (70 loc) · 4.32 KB
/
README.text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Run some sand through your hands
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](http://sourctreeapp.com) (Atlassian’s Git and Mercurial client) or using the command line from Linux or OSX. Or use the [BASH command line tools](http://git-scm.com/download/win) for Windows.
- - -
## A word to the wise
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](https://bitbucket.org/tutorials/bucket-o-sand). 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!
---
## Using SourceTree
###TASK 1. Clone the repository to your local machine
Cloning copies the repository to your local system.
1. 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.
2. Select SourceTree, if it is not already selected, and click **OK**.
* SourceTree may ask for your password several times.
3. Review the information in the Clone new tab. Notice the **Destination Path** is where you will clone your repository.
4. Click **Clone**
SourceTree clones your repository from Bitbucket to your local machine and will open to the new repository.
### TASK 2. Make a change
Learn the Git basics of stage, commit, push when you make a change to the 'sample.html' file.
1. Double-click on your tutorial repo.
2. Select **Working Copy** from the left hand navigation.
3. Select **Show All** from the list above
SourceTree shows the files in the working tree.
4. 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**
6. Using your favorite editor, edit the `sample.html` file.
7. Change the heading from `My First File` to `Playing in the Sand`.
8. Save and close the file.
9. Return to SourceTree.
SourceTree changes the file's icon to modified.
10. Select the 'sample.html' file and drag it into **Staged Files** area.
11. Click **Commit**.
12. Enter a commit message.
13. Press **Commit**.
14. Click **Push** to send your changes to Bitbucket.
15. Click **Commits**, in Bitbucket, to view your change.
- - -
## Using the command line from Linux, OSX or [GitBash](http://git-scm.com/download/win) for Windows.
### Task 1. Clone your repository:
Cloning makes a local copy of the repository for you.
1. Click the **Clone** button in Bitbucket.
2. Make sure the protocol is set to HTTPS.
Bitbucket pre-fills the clone command for you.
3. Copy the command.
4. Open a terminal, or launch a GitBash terminal, on your local machine.
5. Navigate to the directory where you want your files.
6. Paste the command at the prompt.
7. 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](https://confluence.atlassian.com/x/W4DHHw).
### If you are using a terminal's (Linux/OSX/GitBash) command line:
Learn the Git basics of stage, commit, push when you make a change to the 'sample.html' file.
1. Go to your terminal window and navigate to the repository root.
2. Using your favorite editor, edit the `sample.html` file.
3. Change the heading from `My First File` to `Playing in the Sand`.
4. Save and close the file.
5. Stage the file with Git.
`git add sample.html`
6. Commit the change.
`git commit -m "changing sample.html"`
7. Push to Bitbucket.
`git push`
The system prompts you for a username/password.
8. Enter your Bitbucket account name and the password.
9. After the push completes, click **Commits**, in Bitbucket, to view your change.