GIT:Sharing a file between two developers

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.

  1. Rinaldo changes a file.
    1. editing a file causes EGit to notice that a file is changed.
  2. Rinaldo uses EGit to Commit and Push the change.
    1. EGit looks at all the files that have changed and presents them in a dialog box. In this case only one file has changed.
  3. 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.
  4. Fred uses EGit to Pull changes.
    1. Fred initiates a  Pull  and the changes are updated on Fred’s system.
    2. After the Pull Fred has a copy of everything on the server repository in his local workspace.
  5. Fred runs the tests to see what this change has done to his local  environment.
  6. Fred makes a change to some file and Requests a Commit and Push.
  7. 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.
  8. Rinaldo initiates a Pull.
  9. 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.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*