Install Git from this link:- https://git-scm.com/downloads
To check the Git version
git --version
To set the global Git username & email address
git config --global user.name "your name"
git config --global user.email "your email"
Before you follow all these STEPS, make sure you fork
the repository in your account.
This will basically download the git initialized repository on your computer.
If you don't have 2FA enabled, then use the normal HTTPS or SSH link.
git clone https://github.com/TERNA-ENGINEERING-COLLEGE-NAVI-MUMBAI/open-source.git
Personal Access Token (PAT) is required if you enable 2FA on your Github account [link]. For that, use the following command instead of the normal URL command.
git clone https://<GitHubToken>@github.com/<username>/<RepositoryName>.git
Creating a new branch allows you to isolate your changes from the master (main) branch. If your changes goes well, you always have the option to merge your changes into the master branch. If things don't go so well you can always discard the branch or keep it within your local repository.
git branch YourBranchName
By default you're on main branch. So to switch from main, use the following command.
git checkout YourBranchName
Add your GitHub profile link
and your FirstName_LastName_GradYear
in the HTML branch page under the appropriate division.
git add .
5. Make a commit message of the changes you've made. Learn more about conventional commits here.
git commit -m 'Add my contribution'
Now, switch back to main branch to merge all the changes.
git checkout main
git merge YourBranchName
You cannot directly push the changes from your local machine, to do that we have to create a new connection record to a remote repository. After adding a remote, you'll be able to use as a convenient shortcut for in other Git commands.
If you don't have 2FA enabled, then use the normal HTTPS or SSH link.
git remote add <message> https://github.com/TERNA-ENGINEERING-COLLEGE-NAVI-MUMBAI/open-source.git
Personal Access Token (PAT) is required if you enable 2FA on your Github account [link]. For that, use the following command instead of the normal URL command.
git remote add <message> https://<GitHubToken>@github.com/<username>/<RepositoryName>.git
This will push all the changes you've made to the master (main
) branch of your forked repository.
git push -u <message> main
Now, click on Pull Request
button, you'll have the option to create a pull request. i.e., <your forked repo> -> <original repo>
, That's it you're done!