Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I upload existing files to a new repository when "git" is not recognized as a command

Billy Crosbie February 27, 2019

Hi Folks

I've just set up my account, my team and my project, and the project repository. I have files already set up within a local folder structure that I want to upload to the new cloud repository. The documentation says to run this at the command line:

git remote add origin https://wexsoft@bitbucket.org/wexsoft_oracle/milk_sources.git

but when I do this in a Windows Command Prompt window, I get

'git' is not recognized as an internal or external command, operable program or batch file.

What am I missing?

Best regards

Billy

1 answer

1 accepted

2 votes
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 27, 2019

Hi Billy,

Welcome to Atlassian Community.

Have you installed a Git client on your Windows machine? You can download the latest release of Git here.

Billy Crosbie February 27, 2019

Hi Mikael

Thanks very much for the prompt reply. I have installed the latest Git client on my Windows machine.

Now when I try this command:

git remote add origin https://wexsoft@bitbucket.org/wexsoft_oracle/milk_sources.git

I'm getting this error:

fatal: not a git repository (or any of the parent directories): .git

Do you know what this means? I am running a Windows Command Prompt, and have positioned myself in the top level folder where the files and sub-folders for this project are located.

Best regards

Billy

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 28, 2019

Did you run git init within the local folder structure first? This will tell git that this will be a git repository, and when you look in File Explorer you should see a .git directory in there.

Like Billy Crosbie likes this
Billy Crosbie February 28, 2019

Hi Mikael

Thank you so much for your quick reply, and my apologies for being such a nube at this. I have used many other source control systems over the years (e.g. MS SourceSafe, Merant, Subversion etc.) but in all cases they were already configured and we used a graphical front end to check in and out etc.

In this case, we are setting up source control from scratch, and are using BitBucket. As a small test I set up a repository in BitBucket, and was trying to upload the files into it using the commands given by BitBucket. I did not see anything about having to install Git locally - perhaps this was assumed in the instructions. Also, the steps to init, add and commit should probably be spelled out for total nubes like me!

Anyway, I managed to get the repository created locally containing all our test files, and the upload instructions given in Bitbucket then worked fine.

Now I have just one more question, if you don't mind - can you recommend a good graphical front end for Git on Windows?

Thanks again for your help - very much appreciated.

Best regards

Billy

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 28, 2019

Hi Billy,

I can see how it can be a bit confusing, I just checked and Bitbucket Cloud no longer shows what you need to do if you already have the code locally. It used to have a section that described the three commands you needed to run, now you have to click on the link and look in the documentation to get to it (here it is, Add unversioned code to a repository). On Bitbucket Server it is still listed when you create a new repository.

I can recommend Sourcetree which is Atlassian's free GUI for Git.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events