- Carla Mendes
- Michael Foley
- Corentin Aesch
- Diogo Carneiro
- André Gregório
- Ana Modesto
- João Nacho
- Vitor Afonso
- Rachouan Rejeb
This repo was created in order to add practice some collaboration strategies for project 2. It will be a simulation for your real working environment where you will be working with other developers.
- One person from the team should create a new repo
- On Settings, add the other team members as collaborators
- You can either git clone or fork the project (clone is more common for smaller projects)
- Link your local repo to your remote repo and immediately do a succession of add-> commit-> push to see if everything is OK
- To check your remote repo write
git remote -v
on your terminal
- Write good commit messages!
- Communicate so that you avoid working on the same files
- Have a trello board (or similar) to divide your tasks
- Always have other team member as a reviewer of your Pull Request (PR)
- Commit often and as soon as an individual feature (or fix) is working
- Test your code before opening a PR and/or merging
- Make sure your branches are coming from the master branch
- Pull the most recent code and fix your conflicts before merging your PR
- Always make sure you're working with the most recent codebase
- Delete your branch once you're done with it - Keep your tree clean!
- Decide on code formatting rules from the start, Eg.: Everyone uses Prettier, or no one uses it
- Version control DOES NOT replace communication. Keep your team updated on your current work tasks
- Decide on how to split your tasks. Eg.: User Stories
git branch
See all the created branchesgit branch first_branch
Create a new branch called first_branchgit checkout first_branch
Start working from the first_branch branchgit checkout - myCode
Reset directory "myCode" to its original state (undo local changes)git log
To see all your commits on the terminalgit add .
Add your latest changes to your current streamgit commit -m "Your commit message here"
Commit with a commit messagegit push --set-upstream origin first_branch
First time pushing your changes to your first_branch remote branchgit fetch
Downloads the new changes from the remote repository but does not change your local repository. Think of it as checking the state of the remote repository.git pull
Downloads the new changes from the remote repositories and update your local repositorygit commit --amend -m "New message"
Edits a commit message. This creates a new commitgit reset HEAD-2
Undo last 2 commits (locally) and keep changesgit reset --hard HEAD-2
Undo last 2 commits (locally) and discard changesgit reset filename
Remove a file from the staging areaecho filename >> .gitignore
Adds file to .gitignore filegit revert c856893c
Revert pushed commit c856893cgit remote add upstream connection-url
When you fork a repo and need to add the "parent" repo as upstream, use this commandgit pull upstream master
Pull from the upstream repo, master branch