INSTALL GIT AND WATCH GIT VIDEOS ON VERSION CONTROLLING.
For Collaborators
-
How to pull the project to your local repository:
- Open git bash where your project folder is:
- Right click on project folder
- Click on "Open git bash here"
- Git Initialize (if not already done) your project folder so that you can use git functionalities with it:
- git init
- Pull the contents of the remote repository into your local repository branch (Could be master branch or other branches):
- If your local repository is already linked with the remote and you want to pull the updates from the remote to local:
- git pull
-
How to push changes onto the remote branches:
- Add the changed files onto the staging area:
- git add "filename" or to add all files
- git add .
- Commit the changes with a short but comprehensive message:
- git commit -m "type your message here"
- Push the changes to the remote repository:
- git push -u origin branchname
- Add the changed files onto the staging area:
-
How to make branches in local repository:
- If you are in the master branch and you want to make a branch from the master branch:
- git branch "newbranchname"
- If you want to change branches:
- git checkout "branchname"
- If you are in the master branch and you want to make a branch from the master branch:
-
How to merge branches:
- If you want to merge the changes of branch 2 with branch 1:
- git checkout "branch 1"
- git merge "branch 2"
- If you want to merge the changes of branch 2 with branch 1:
NOTE: GIT IS COMPLICATED AT FIRST SO PRACTICE BEFORE GIVING ANY COMMANDS. THERE IS NO TIME TO ROLLBACK THE MISTAKES YOU MAKE.