I don't know why it's not working in both the ways

I tried all the possible solutions for both of them and still unable to fix them.Also i made changes to the app before pushing but still :frowning:

Where are you trying to push it to? Do you have a github repo somewhere you want it to update? If you have a repo somewhere you want to push it to, you can add the URL like this:

git remote add origin <URL>

So if your github name was naimiii and your project was just called udacity-nano-degree, then git remote add origin https://github.com/naimiii/udacity-nano-degree.git would let you push your code to it. Note: in order for that to work , you will need to go to your github and make a repo for the project called udacity-nano-degree. If it doesn’t exist, you’ll get that error every time you try to push it.

Let me know if that helped.

Yeah i already have a github repo.

It thinks you’re using a monorepo structure, and the version of babel-eslint in the parent folder conflicts with the one that is installed as part of cra

You have a project folder with a package.json and some dependencies. You are trying to install create react app as a subfolder of this

As explained [as much as was possible] in the other thread, you have a got a git repo cloned into a git repo. These are two seperate issues (albeit connected as one is causing the other, and possibly vice versa)

Is this thread related to this other thread? If so, they should be combined. Also, if they are related, @naimiii please do not create multiple topics for the same issue. Instead, just post to your original topic any other information or questions you may have.

No , in udacity nano degree folder I created a cra folder. there’s only 1 package.json file.

when i create anew branch and push the code to the github repo then it’s still behaving weird. Look at these screenshots.

It is probably time for you to start over on this project. It does not seem you got to far anyway, so you would not be losing much.

1, Delete the my-app folder from your local computer.
2. Delete the repo from GitHub
3. Create a new repo on GitHub named my-app making sure not to add a README.md file or anything else during the repo creation process.
4. Use create-react-app again that will create a new my-app folder.
5. CD into the my-app folder and run the following commands:

git remote add origin git@github.com:yourGitHubUsername/my-app.git
git push -u origin master

Now your GitHub master branch will match your local version.

Now you can create new branche to commit changes to and merge back into your local master when you have made some significant changes. Once merged, you can execute:

git push -u origin master

and GitHub will have your local changes.

Thanks but i want to add my all small projects into the one main folder . Hope you got my point.

You can do that also, but using create-react-app will create a separate git repo in each subfolder. Locally, you can store each project in one main folder, but I highly recommend to have separate repos for different projects unless they are all apart of the same site. It will simplify your life with Git/GitHub.

If you really want to have all your code in one big repo on GitHub, then you will need to first delete the .git folder in the subfolder created by create-react-app each time you use it and make sure you run git init in the main folder in the very beginning.

I still do not recommend this structure for your repo, but you are free to do as you choose.


In future, can you please, please, please explain what you are trying to do up front, not several hours later. Just provide some kind of context.

That last post is the critical piece of information that you didn’t explain despite being asked over and over again to do so, across two threads.

Thanks your suggestions but all these projects are a part of my nano-degree that’s why i will make a one big folder for my easiness. Hope you understand.

Like I said in my previous reply, as long as you keep in mind you only want the main folder to be a git repo and delete all other git repos contained in other sub folders, you can do this without too much trouble.

1 Like