Domanda

It's really unfortunate that there are no complete SourceTree tutorials out there.

I'm trying to create a really simple git project to learn my way around git and SourceTree. So here's what I did:

  • I created a new folder and started an html page in it.
  • In the Git Bash, I navigated to the directory and commanded git init
  • I created an account on BitBucket, I clicked "Create New Repository" and filled in the Name, Description, etc.
  • I opened SourceTree with the goal of pushing this repository up to Bitbucket and then continuing to work on it (since I don't see any other way of starting up your project directly in BitBucket)

Can someone experience guide me as to what the next steps are to getting the repository set up on BitBucket using SourceTree?

È stato utile?

Soluzione

Use the "Clone / New" button and "Add a Working Tree". Choose the folder on disk where you ran git init. This will get your repository into SourceTree.

To push to Bitbucket, you'll need to add your remote repository URL. While your repository is open in SourceTree, click the Settings button and add a remote. Choose to make this the defualt remote repository with the checkbox and put the URL of your repository in the URL field (for example, "https://bitbucket.org/your-name/your-repository").

You can also do this second step from the Git Bash using the command:

git remote add origin https://bitbucket.org/your-name/your-repository

After this, you can commit and push your changes to Bitbucket.


If you wanted, you could also have created the repository directly in SourceTree by using the "Clone / New" button and choosing "Create a New Repository". This does the same thing as the git init command and immediately puts the repository in SourceTree for you to use.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top