switch to your folder (E.g
Note: You are erase the git files of the old repository completely by using
rm -rf .git before
And you may have a problem while you push it to the master, and if the error is like the following:
You can fix this problem by pushing it to the git forcedly using command
git push -u origin master -f
If you are pushing a folder to the repository which contains some files already, you need to merge the local branch with the remote branch first. The command should be:
git pull --rebase origin master
You may need to list the remote branch, and you can do that by using:
Then you can download the repository from GitHub using
git checkout branchName && git pull
(Switch to the targeted branch and pull the code)
This post is still updating through my programming experience. 🙂 Feel free to leave a comment and tell me which problem you are facing with Git. It will be good to configure that out together. 😀
I have faced a problem that when I am developing a React App, I don’t want to add the node_modules/ to my git repository. So how can I ignore it when I uploading it?
Type the following:
to the .gitignore file (type: :wq to quit and save).
Then you will ignore node_modules/ automatically when you git add and git commit!