add-remote
- Usage: `java gitlet.Main add-remote [remote name] [name of remote directory]/.gitlet
- Description: Saves the given login information under the given
remote name. Attempts to push or pull from the given remote name
will then attempt to use this
.gitlet
directory.
By writing, e.g.,
java gitlet.Main add-remote other ../testing/otherdir/.gitlet
you can provide tests of remotes that will work from all
locations (on your home machine or within the grading program's software).
Always use forward slashes in these commands. Have your program convert
all the forward slashes into the path separator character (forward slash on
Unix and backslash on Windows). Java helpfully defines the class variable
java.io.File.separator
as this character.
- Failure cases: If a remote with the given name already exists,
print the error message:
A remote with that name already exists.
You don't have to check if the user name and server
information are legit.
- Dangerous?: No.