Why could you not push to master? Did it by any chance say something like the tip of the remote is ahead of yours, then just refuse to push?
Because if you created a repo with a README, you need to pull that down before you can push more changes, else it’ll be out of sync
I already pull the README file .
when i push it to the master it behaves like this.
.For the solution, I used ‘git remote -v’ command to fix it but it did not work.
remote -v
just outputs information. What is the output?
At the minute you either do not have a remote repo connected, or you’ve added the wrong one, that’s what the output of git push
is telling you
I pushed the code but the folder i pushed i not open up on GitHub
git remote remove origin
To make sure git forgets what’s already configured, then
git remote add origin https://github.com/your-username/the-name-of-the-repository
What’s in that folder. It is not by any chance another git repo? Does it have a .git
folder in that folder. Because github uses that icon to denote a git submodule, this is almost definitely something you do not want.
It has a .got folder inside .
Actually i copy the code from the clone repo and add it to the new folder .Maybe that’s the cause of this.
Yes, it is. What I think you have done is you have a repo, so a project in a folder. You’ve then, inside that folder, cloned the repo, so you have a project inside a project.
But when i try to run the clone repo it’s producing errors
I m unable to run the create-react-app into my local machine. All the time it’s giving me the same error.
You’re doing something very strange here, it isn’t currently possible to tell what you’ve done though. Can you go through, step by step, how you got to this point.
Are you talking about create-react-app Or that contact app project?
You have a habit of just stating a complex situation you are currently in and expecting people to be able to somehow figure out everything that led up to that point. I’m not telepathic. I don’t know what you’ve done or what you’re trying to do.
There is no way for me to answer that because I don’t know how those two things fit together, you don’t explain anything.
Thus far I glean:
- you created a repo on GitHub, and initialised it with a README
Then you did these two things in unknown order:
- you either
git cloned
this repo into a folder
- wrote some code in a folder then added the repo as a remote (
git remote add ...
)
- in the parent folder, you did a
git init
, then added the repo as a remote (git remote add ...
)
I have no idea what CRA has to do with this, you never explained anything apart from “it didn’t work”, which is meaningless to anyone who isn’t you.
Thanks for the long note.
This is very frustrating:
-
What are you trying to do. As in, literally, what are you trying to build. It is really helpful if you can just explain what you are trying to achieve and what you have currently done. How did you set it up.
- How did you get to this position. What sequence of things did you do
- to put this another way, if I asked you to set up the project you are trying to set up, from scratch, how would you go about this