Pull changes from your repository on Bitbucket

このページの内容

  1. Create a Git or Mercurial repository
  2. Copy your repository and add files
  3. Pull changes from your repository on Bitbucket
  4. 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:

  1. From your BitbucketStationSupplies in Bitbucket, click Source to open the source directory.

    Notice you only have one file, supplies.txt, in your directory.

    • A. Branch selection: Pick the branch you want to view.
    • B. Source page: Click the link to open this page.
    • C. New file button: Edit and create a file in Bitbucket.
    • D. Source file area: View the directory of files in Bitbucket. 
  2. 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.

    • A. Branch with new file: Change if you want to add file to a different branch.
    • B. New file area: Add content for your new file here.
  3. Enter supplyrequest in the filename field.

  4. Select HTML from the Syntax mode list. 

  5. Add the following HTML code to the text area:

    <p>We are requesting additional supplies. Please send us the following:</p>
    <ul>
        <li>space ice cream</li>
        <li>nerf darts</li>
        <li>telescope light shield</li>
    </ul>
  6. Click Commit. The Commit message field appears with the message: supplyrequest created online with Bitbucket.

  7. 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 in the sidebar.

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:

  1. 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.

  2. Click OK from this box. Sourcetree updates with a description of the merged file.

  3. 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.

次へ

最終更新日 2017 年 9 月 13 日

この翻訳に満足しましたか?

はい
いいえ
この記事についてのフィードバックを送信する

Not finding the help you need?

コミュニティへの質問

Powered by Confluence and Scroll Viewport.