Reputation: 7
I'm new to React I'm wondering what's the process to upload a project to GitHub, which files should I push? and when someone else does the git pull, how should he proceed? which commands should he type?
Thanks in advance.
Upvotes: 0
Views: 3718
Reputation:
first, you need to create a repo on GitHub and then push your codes. using these commends.
git add .
git commit -m "subject"
git push origin and your branch: for example git push origin master
.
and then the other can clone you're code and work on it.
Upvotes: 0
Reputation: 1109
The CRA will initialize the git when you create a new project... So you just need to add a remote address (the address of your repo on git server, like GitHub....). After that needs to push changes/commits to Github.
And about git-pull, which's used to fetch files/contents from the git server, when u want to get new changes from the git server, you will use the git-pull command.
Let me write a series of general steps for upload your project on GitHub:
1- create a repository in Github
2- initialize git in your project folder:
git init
3- add the remote address:
git remote add <remote-name> <remote-address>
4- add untracked files to stage:
git add -A
5- Record changes (commit):
git commit -m "subject" -m "description (optional)"
6- send ur changes to the git server (Github)
git push -u <remote-name> --all
after that, if you need to get the changes from GitHub (PULL), you just need to use git-pull:
git pull <remote-name> <branch-name>
NOTE: This explanation was very general, be sure to research about GIT after reading this, there are good courses on YouTube about git...
Upvotes: 1