- Project Requirements
- Instructions
- Appendix 1: Branching Workflow
- Appendix 2: Common Terminal Commands
- Appendix 3: Common Git Commands
The system allows pet owners to search for care takers for their pet when they go out, travel or cannot take care of their pet for any reason. Both users and pets have a profile. Users of the service advertise their availability (when they can take care of a pet, for how long, the kind of pet they can take care of and other constraints and requirements) or browse and look for a care taker and bid. The care taker or the system (your choice) chooses the successful bid. Each user has an account. Administrators can create, modify and delete all entries. Please refer to dogvacay.com or similar sites for examples and data.
Replace the petcaring
folder in your local mappstack
. Restart the server using manager-osx
or Terminal, and go to localhost:8080/petcaring
to see the site.
Note that to see other sites at the current moment, such as the search
site, you have to manually proceed to localhost:8080/petcaring/<fileName>
since routing has not quite been done yet.
To test for add
, use pgAdmin 4
to visually check the data. Otherwise, use search
to check for the data.
Remember to change the name of the database and the password!!
This project uses a branching workflow, which essentially means that we should create a new branch every time we start work on a new feature/component.
The basic workflow can be summarised into the following steps:
- Before starting a new feature, create a new branch
Go into the project directory using Terminal (and cd
). Then, check that you are on the master
branch by doing git status
. If you are on the master branch
, it will indicate that you are On branch master
.
To create a new branch, do git checkout -b <branchName>
, where <branchName>
is the name of your new branch. It is recommended that you name the branch descriptively, i.e. related to the feature that you are currently working on. Note that a new branch with <branchName>
will be created, and you will automatically be switched from the master
branch to the <branchName>
branch.
Note also that if you do this on another branch aside from the master branch, say, branch search
, your new branch will include all the changes in branch search
as well, which is probably not what you wanted.
- Make changes within your local repository, and commit the changes
Make changes you need on the <branchName>
branch. Add the changes by doing git add <fileName>
or git add *
(if you want to add everything), followed by git commit -m "<commitMessage>"
to add a descriptive and short commit message for your changes. Alternatively, do git commit
, then press a
to enter INSERT mode
before keying in your commit message. Exit INSERT mode
by doing ESC
, then :wq
.
- Push the branch to the remote repository
To push the branch to the remote repository, do git push origin <branchName>
, or do git push -u origin <branchName>
. The second option allows you to simply do git push
without any parameters the next time you want to push the same branch to the remote repository.
- Open a pull request
Proceed to GitHub, find your branch, and open a pull request. Wait for your group members to see, check and test your changes, before merging the branch into the remote repository.
- After a successful merging, delete unwanted branches
After the branch has been merged successfully into master
, the branch is now essentially useless and can be deleted. Delete the branch on the remote repository via GitHub. To delete the branch on your local repository, go to the Terminal, switch back to your master
branch by doing git checkout master
, and delete the branch by doing git branch -d <branchName>
followed by git branch -D <branchName>
.
- Update your local repository
To sync your local repository with the remote repository, do git pull
while on the master
branch.
cd <folderName>
: change directory (folder) into another foldercd ../
: go back to the outer foldercd
: go to the rootls
: see the files and folders in the current directory
git status
: check what branch you are on, what files are being tracked, and ready for commitmentgit log
: show commit history for a branchgit log --graph
: show commit history for a branch in a nicer waygit checkout <branchName>
: switch to an existing branchgit checkout -b <branchName>
: create a new branch and switch to that branchgit branch
: lists branches in your local repositorygit branch -v
: lists branches with latest commit details in your local repositorygit branch -d <branchName>
: delete a branchgit add <fileName>
: stage files for commitgit commit <fileName>
: commit filesgit commit <fileName> -m "<someMessage>"
: commit files with short commit messagegit push origin <branchName>
: push a branch to the remote repositorygit remote
: see all remotesgit remote -v
: see all remotes and the remote repository each remote is pointing togit pull
: sync local repository with remote repository (auto merging of changes in remote repo with local repo)git fetch
: get changes in remote repository without merging into your local repository