EGit is a distributed source code control system providing versioned sharing of files with local copies that are full copies of the repository. You can use the steps below to work with other team members on the project without resorting to using email or some other process when working on the same files. You can use EGit to be confident that you are working on and looking at the same file. Throughout the course, tasks that are needed for the Bank Project will be explained with use cases.
Sharing a file between two developers (Rinaldo/Fred)
Rinaldo and Fred want to share some code. They are both working in the “development” branch. Rinaldo has made a change to a file. Fred needs to get that change and add additional modifications. The starting condition requires that both Rinaldo and Fred have a local copy of the workspace. The workspaces are copies of the server workspace, which you imported from earlier. In this example we want the two workspaces to be equivalent in terms of content and passing the tests. To verify that the code in the two local workspaces are equivalent, follow the steps in How to tell if two repositories are equivalent. If you have been working in a workspace and have changes you would like to keep but are not ready to commit them you should contact the list and we will provide directions. If you want to make your workspace equivalent to the remote repository and you are willing to abandon local changes we can provide directions for that.
- Rinaldo changes a file.
- editing a file causes EGit to notice that a file is changed.
- Rinaldo uses EGit to Commit and Push the change.
- EGit looks at all the files that have changed and presents them in a dialog box. In this case only one file has changed.
- Fred is informed of the change by Rinaldo using email, chat or some other preferred mechanism. Egit can email the team members when a change occurs but this is intentionally off.
- Fred uses EGit to Pull changes.
- Fred initiates a Pull and the changes are updated on Fred’s system.
- After the Pull Fred has a copy of everything on the server repository in his local workspace.
- Fred runs the tests to see what this change has done to his local environment.
- Fred makes a change to some file and Requests a Commit and Push.
- Fred informs Rinaldo of the change using email, chat or some other preferred mechanism. Egit can email the team members when a change occurs but this is intentionally off.
- Rinaldo initiates a Pull.
- At this point both Rinaldo and Fred have identical copies on their local machines.
You can try this out with the 5A and 5B options here.