public synchronized String commit(ObjectOutputStream output, ObjectInputStream input, int clientNumber) throws IOException {
			String answer = "";
			try {
				CommitObject oldhead = (CommitObject) input.readObject();

				//kijken of de vorige head op de clientside gelijk is aan de huidige head op de server
				// --> deze client is de eerste die iets aanpast aan de server
				if (VcsServer.srepo.HEAD == null || VcsServer.srepo.HEAD.equals(oldhead)) {
					output.writeObject("ok");
					output.flush();
					CommitObject newhead = (CommitObject) input.readObject();
					String ID = newhead.ID;
					VcsServer.srepo.HEAD = newhead;
					VcsServer.srepo.putHead();
					directory.createDir(ID);
					directory.changeWorkingDir(ProjectDirectory + File.separator + ID);
					VcsServer.srepo.putMetaFile(newhead);
					int numberOfFiles = (Integer) input.readObject();
					String keyPath = ProjectDirectory + File.separator + ".client" + clientNumber + File.separator + ".my_private.key";
					ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream(keyPath));
				    final PrivateKey privateKey = (PrivateKey) inputStream.readObject();
				    inputStream.close();
					for(int i=0; i<numberOfFiles; i++) {
						Utilities.receiveFile(input, ProjectDirectory + File.separator + ID, privateKey);
					}
					String clientStatus = (String) input.readObject();
					if (clientStatus.equals("succes")) {
						answer = "The files are succesfully commited";
					} else {
						answer = "Something went wrong while transferring the files";
					}
					
				} else {
					answer = "You don't have the latest version, please update your working directory";
				}		
				
			} catch (ClassNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return answer;
		}