how to use git with local code?

I have my code on local system. I would like to keep versions of that software code, so that I can use different versions with same code.

I would like to keep that in git and with source tree.

Any once has idea about using git with local code and how to add these local files in ST and bitbucket? 

1 answer

Yes, this is very normal usage of Git.

Here are instructions for creating the local repo and pushing it to Bitbucket:

When they say to use Git Bash, the easiest way to do that is to use the Terminal button in SourceTree.

After those steps are completed, you can add the local repo to SourceTree using the Add Repo button (or File > Clone/New...", and choosing "Add Working Copy":

image2016-5-18 11:1:12.png

Thanks you so much appreciated your response.

When I commit the code to ST, its showing me below error, can you please tell me how to change my credentials in ST? 



git config --global ""
git config --global "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

Awesome Seth Foss. It worked. appreciated.

For the identity thing, just run the commands it is instructing you to run in the git terminal. Make sure to put a valid email and name instead of "" and "Your Name".

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

229 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot