Problems while using git

Hi everyone! When i execute the command

  • git remote add upstream https://github.com/openmrs/openmrs-core.git the result i get it fatal: not a git repository (or any of the parent directories): .git I am aready in the openmrs-core folder.
  • i get the same out put when i try to run git pull --rebase upstream master and all other git commands

@jnsereko try to make sure the url is the one pointing to upstream not the the one forked

yes it is pointing to the upstream as showed in the screen-shot above

@jnsereko this means that you are not executing the command at the root folder of openmrs-core,make sure you are at the root folder which is openmrs-core not openmrs-core-master,and when i look at your command prompt,it looks like you downloaded a ziped file,try using git clone so as you get openmrs-core to your machine

I executed the git clone command but my internet connection was very poor. it could only execute to 15% and show failure. so i Decided to use the ziped file i downloaded weeks ago.

1 Like

had the same problem yesterday cloning is what saved me !!

Ok let me Clone and see i will post the result right now when i clone, this is the result i get

1 Like

The zipped file does not contain the .git directory which is needed by git.

You can either clone the repository, or after unzipping the file, execute git init within the root of the project directory, that should initialize a .git directory.

However, if you want to view the commit history and work on the project you’ll need to clone the repository instead of downloading the zip file.

1 Like

Thanks all of u for your help. I have executed the command git init and the output i have got is Initialized empty Git repository in C:/Users/admin/openmrs-core-master/.git/ So after this should i continue with adding upstream using git remote add upstream https://github.com/openmrs/openmrs-core.git

1 Like

go on and do that!

Assuming you’re planning to contribute to OpenMRS, it is better to clone the repository, that way you have access to the commit history.

Setting the upstream URL is common to both the methods so you can go ahead with that.

@captaindavinci Assuming you’re planning to contribute to OpenMRS,

yes i am planning to contribute to OpenMRS but i will clone when my internet is better. So will it be bad if i don`t get access to commits? Like will i cause errors or anything related to that?

Actually, I haven’t tried that method so I’m not sure if it’s okay to continue with the zip file.

But till you clone the repository, I guess you can try and let us know. :slight_smile:

I found this post on SO which might be helpful https://stackoverflow.com/a/38909009/7213370.

move on don’t fear breaking stuff,kindly let us know in case of any problems.

1 Like

thank you guys :hugs: :hugs: