Some general overview and rules are the bare minimum to be expected from any contributor in this repository.
For starters, if you're completely new to git then cloning is likely the first thing you should learn (or already know)
Cloning will take a repo and save it locally to your drive in a folder of the repo name in the working directory you initiated the command
If it errors out, then you don't have an ssh key linked to your GitHub account. For now you can just use https, or you can head over to the SSH Setup Guide.
Images for reference on how to find the URL to clone for this and any projects: (select the HTTPS tab if you don't have ssh setup)
You can think of a branch as a timeline of its own where master is the actual timeline, and other branches are "alternative" timelines where some small changes might've happened.
In our project, we would ideally like each group to have their own branch to work on, so that we don't cause conflict issues or other problems where someone might accidentally delete a file.
If a team believes they made changes that are solid and can be "deployed" in a testable manner that is successful, they can then "ask" to merge their branch into master.
This act of "asking" to merge is called creating a pull request. Someone then has to approve the pull request and all changes made are then merged into master. Ideally you don't want to approve your own merge.
At the time of writing, there are currently two branches. You can view this by running the following command in the project directory.
* master
web-server-dummy
(END)
Note that this uses a vim-like interface, so hit q to exit this view
To create a new branch for you and your team to work on, or whatever it may be, the syntax is as follows:
the -b flag means to create a new one, otherwise without it you'll just change to an existing branch (if it exists)
First you add files you want to later commit. Generally you would be in your project directory, and you would run the following command:
Adding effectively stages files to be committed, i.e. the next time you commit only the files added with git add
will be committed.
Lastly, to push these changes to the remote git repository (like GitHub) you would run the following command:
Note: you will already have a remote that points to the remote repository (first argument), and the branch you want to push the locally updated version (second argument).
You might be asking, why do I already have an origin remote? Well, when cloning a repository, your local cloned repository has a "remote" that points to the remote repository, which is usually called "origin".
For anyone interested, if you create a new directory that you plan to put on a remote Git repository later, you can create a remote that points to the remote repository by running the following command:
As briefly mentioned earlier, if you're working on your own branch and think you've made sufficient progress to have your changes merged into the production/master branch,
you can ask to merge by creating a pull request. This can be done on GitHub quite easily with images shown below:
Then you want to click on the branch you're working on, which in my case is "web-server-dummy"
Notice the "Contribute" button? Click it!
Click "Open Pull Request"