Codebase for react native app, Website and Backend
- React native app
- Cloning repo
- Pushing to remote repo
- Pull changes
- Warning or error while pulling
- Removing conflicts
- So you have cloned the repo, lets try out the react native app
- move to SIH-BRAINCELLS
- now open the folder named 'React_native_app' in VS code or your preferred code editior
- 📒 N.B. (as node modules are not pushed to github repo) you need to install node modules
- As you move to the folder 'React_native_app', open the terminal for this folder using ctrl + ` , if this command doesn't work in your machine, just simply you can open terminal from the menubar of VS code.
- now type to install node modules
npm install
- Now you are good to go.
- run
npm start
. this will generate a QR code for scanning - Now in your phone install
expo
app from playstore - Open the
expo go
and scan the QR code generated in your terminal. - Enjoy the app.
-
First you should have git installed in your local computer
-
Create a folder for this repo
-
open the newly created folder with terminal
-
copy the HTTPS url from this repo code(green colored button)
-
Lets move to your terminal
-
enter this
git clone https://github.com/KrishnenduDakshi2002/SIH-BRAINCELLS.git
-
Now you have this repo in your local
-
Be careful while pushing code
-
Open the
SIH-BRAINCELLS
in terminal -
type
git status
--> to check what are the files you have changed in your local copy -
git add .
--> adds all change in the working directory to the staging area -
git commit -m "commit messge"
---> please give a good commit message what you have changed -
git push origin main
---> pushing changes to remote repo
Lets clear this
-
Ankesh cloned this repo at 10:00 AM and also Arjya cloned this repo at 10:10 AM and both wants to work on a same file README.md (note that they don't know each other)
-
Now they have the same copy of this repo in their local
-
Ankesh started developing and makes some changes in the README.md file and he finished his developing 10:30 AM, he wants to push changes to the main branch, he ran some commands (you will get to this commands very soon) and find out that there is no changes have been made to this repo, so he pushed the changes to main branch, so main branch has Ankesh's changes.
-
Let's move to Arjya's developement, she has been developing on her version of README.md and she completed her developement at 10:45 AM, she is pretty satisfied with her changes in README.md, she wants to push her changes to main branch( Arjya still doesn't know that Ankesh's changes were already pushed, but she guessed that there might be some changes in the main repo).
-
Before pulling any changes from the remote repo (main branch), Arjya needs to commit her changes in the local version of repo else when changes will be pulled her chagnes will be lost, so she followed the above guide
Pushing to this repo
uptostep 5
, then she ran the following command to check is there any changes made in the remote repo.
git add .
git commit -m "Updated README.md by Arjya
git fetch
-- > to update the local repo's metadata(which gives the you the info about any changes)
git log --oneline
--> to log the the changes have been made
git pull origin main
--> pulling the changes made in the remote repo
It will show Auto merge conflict as Ankesh already pushed his code
Now Arjya can see the conflicts in the README.md file by opening the README.md file in VS code
She can now see both her code and Ankesh's code Now it's her decision what she wants to do, see can remove Ankesh's code or keep the code untouched
.DS_Store sometime creates problem, while pulling and display 'unstaged changes'
1.git rm --cached .DS_Store
[if .gitignore wasn't created initially]
2.then create .gitignore
and add .DS_Store
you can type git config --global pull.ff true
then you can pull
getting this error after the first step fatal: refusing to merge unrelated histories
git pull <remote> <branchName> --allow-unrelated-histories
For more details followissue link
<<<<<<<< HEAD
Arjya's code
========
Person 1's code
--> May be it is Ankesh's code
========
Person 2's code
--> May be it is Ankesh's code
========
Person 2's code
--> May be it is Ankesh's code
'>>>>>>>>> BRANCH_NAME'
Arjya don't know which is Ankesh's code She will ask the maintainer what to do or she can do anything
Arjya's code
Person 1's code
--> May be it is Ankesh's code
Person 2's code
--> May be it is Ankesh's code
Person 2's code
--> May be it is Ankesh's code
Arjya removes the notations before push to the main