A project for practice using git during group projects, with this repository being the project manager.
This repo follows the method written by sir Andrew Matheny's This Medium Post. All credits goes to him.
The project will be managed as the folloing image:
with you acting as the group member, forking and sending pull request to this repositiory.
Use the command sudo apt-get install git
to install. Type git --version
to confirm.
Get GitBash and install. After install, you should be able to open a command prompt through the .exe file.
Then use the following commands to setup user.name
and user.email
. It is used to identify commits.
git config --global user.name "<Your name>"
git config --global user.email "<Your email>"
- Click Fork on the main repositiory.
Now you should have your own fork.
- Clone the forked repositioy with
git clone https://github.com/ <Your GitHub ID> /Group-Project-Practice.git
.
Now you should have the forked repository on your local machine. Use the command
ls
to confirm.
- Use command
git remote -v
. You should see a remote namedorigin
. - Use command
git remote add upstream https://github.com/Uduru0522/Group-Project-Practice.git
This is to set connection to the main project. This way you can pull updates on the main repo. (The arrow labled "C")\
- Make your changes and commit. The instructions on properly making change on projects are at below.
- Run
git push origin main
to push changes to your fork.
You should be able to see the updates on
https://github.com/ <Your GitHub ID> /Group-Project-Practice
- At the website, click "Send Pull Request". After the project manager merges, you can see the changes on main repo.
Beforing making changes, you should fork and clone the repositiory, and set up the upstream to the main repo (~step 4 of above). Then:
- Update local with central repo. (
git pull upstream main
, This is step 5 of the above steps) - Set up a new branch with
git branch <new branch name>
. Always keep the master branch a runable thing - Switch to the created branch with
git checkout <new branch name>
- Make code edits. You can use
git status
to see what changes are made. - Use
git add .
to add all changes files to commit. If you only want to commit some, usegit add <filename>
. - Run
git commit
and write commit message. If the file is saved successfully, the change is done. - Go back to master branch with
git checkout main
. - Merge the two branchs with
git merge <new branch name>
And you've done the editing. Nice.