Pull changes from your repository on Bitbucket
- Create a Git or Mercurial repository
- Copy your repository and add files
- Pull changes from your repository on Bitbucket
- Use SourceTree branches to merge an update
Next on your list of space station administrator activities, you need to file out a request for new supplies. Let's set up a system for getting supplies to our Bitbucket space station. With just a bit more knowledge of Bitbucket and SourceTree, we'll be supporting our space exploration for years to come!
Step 1. Create a file in Bitbucket
To add your supply request file, do the following:
From your BitbucketStationSupplies in Bitbucket, click Source to open the source directory.
Notice you only have one file,
supplies.txt, in your directory.
From the Source page, click New file in the top right corner. This button only appears after you have added at least one file to the repository.
A page for creating the new file opens, as shown in the following image.
supplyrequestin the filename field.
Select HTML from the Syntax mode list.
Add the following HTML code to the text area:
Click Commit. The Commit message field appears with the message:
supplyrequest created online with Bitbucket.
Click Commit under the message field.
You now have a new file in Bitbucket! You are taken to a page with details of the commit, where you can see the change you just made:
If you want to see a list of the commits you've made so far, click Commits link on the left side.
Step 2. Pull changes from a remote repository
Now we need to get that supply request form onto your local system. The process is pretty straight forward, basically just the reverse of the push you used to get the
supplies.txt file into Bitbucket.
To pull the file into your local repository, do the following:
Open your repository in SourceTree, and click the Pull button.
A popup appears to indicate that you are merging the file from Bitbucket to your local repository.
Click OK from this box. Sourcetree updates with a description of the merged file.
- Navigate to your repository folder on your local system and you'll see the file you just added.
Fantastic! Now, you have finished the basic DVCS workflow (clone, add, commit, push, and pull) between Bitbucket and your local system.
Was this helpful?
Thanks for your feedback!