1. Home - SarthakJha/IECSE-Web-Summer-21 GitHub Wiki
- Git is an open-source system, that is used for version control while developing software. It is used for tracking changes and is meant for easy collaborations.
- Github is where you can host your git repositories, and collaborate using git on the internet. Github can be used from the browser or from the git command line.
- Instructions to install git on Linux, macOS, and Windows can be found here: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
-
Open the Terminal in your project's location if you're using Mac or Linux. Windows users can open Git Bash which is a terminal installed along with Git(Right-click and click on Git Bash here).
-
Clone the repository using
git clone https://github.com/SarthakJha/IECSE-Web-Summer-21.git
-
Move to this directory using
cd IECSE-Web-Summer-21
-
Create a new branch with your name using the command
git checkout -b <branch-name>
, with branch name in format "-". eg.-git checkout -b <your-name-here>
-
All commits should be made to your own branch, Never commit to master. To prevent this always check what branch you're on before committing any changes, the command to check current branch
git branch
, the command to checkout(change to) a branch,git checkout <branch-name>
-
To pull, change branch to master and do a git pull.
git checkout master
git pull origin master
-
Make Sure to switch back to your own branch after viewing the content.
- Open Git Bash in your project folder and run the following commands to make a folder for each week
Example:
mkdir task1
cd task1
code .
- After your task is done you need to push it to GitHub
- Make sure you are in the root of your project and not in your week folder before running these commands. You can come out of your week folder with the command
cd ..
- Add files to be committed using the command
git add .
(the "." after add means all files in the current directory will be added) - Add a descriptive commit message for the same. Command-
git commit -m "<message>"
. Mention any errors or issues in the code in the commit message, if any. - Finally, push your code. command -
git push origin <branch-name>
git checkout -b <branch-name> // Use your full name in the format first-last for your branch name
git checkout <branch-name> // to make sure you are in your own branch
git add . // adds all files and subfolders to be committed in the current directory
git commit -m "message"
git push origin <branch-name>
- All tasks will be posted on the wiki
- Do not hesitate to DM your mentors regarding any doubts you may have