# cob-cli updateFromServer command

cob-cli updateFromServer [--servername <servername>]

This command is provided to get the repository updated with files from server - in other words, it copies the server's content into the user's local repository/folder. This will not instantly replace files - instead, it will only change files that are different from the server and confirm with the user first. Frequent usage of this command is not expected, and shouldn't be necessary unless changes were made directly to the server's content and/or outisde of the cob-cli process.

# Execution Details

In line with other commands such as cob-cli test and cob-cli deploy, cob-cli updateFromServer also makes a series of consistency checks. Once validated, then the command can execute successfully.

# Consistency Checks

Before cob-cli updateFromServer is able to copy the files from the server, it will run the following consistency checks:

Checking conditions to update cob-cli files from <server_name>.cultofbits.com
  Check connectivity and permissions
  Check there's no cob-cli test' running
  Check git status
  1. Check connectivity and permissions It starts by verifying if the user has permission to connect to the server itself.
  2. Check there's no cob-cli test' running Since other users may be running tests in the same server we are working on, there may be other (temporary) files that we do not want to copy over to our machine. To avoid this, it verifies if there are tests running. If it detects tests, the command is aborted.
  3. Check git status For the final check, cob-cli updateFromServer will ascertain if the user has a clean working tree/local repository. In other words, it checks if the user is either 1) behind the origin of the current branch 2) has uncomitted or unstashed changes.

# Options

--servername <servername>
		Specify the name of the CoB server you want to update from.
		
-e --environment <env_name>
Name of the target environment.