how to use git with local code?

Rucha D May 18, 2016

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

1 vote
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 18, 2016

Yes, this is very normal usage of Git.

Here are instructions for creating the local repo and pushing it to Bitbucket: http://stackoverflow.com/questions/17570446/how-to-add-gitbitbucket-to-existing-source-code-folder

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

Rucha D May 18, 2016

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? 

 

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

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

Rucha D May 18, 2016

Awesome Seth Foss. It worked. appreciated.

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 18, 2016

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 "you@example.com" and "Your Name".

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events