My Quick Reference Guide
Here are sets of commands that are commonly used and the order that they are they are usually issued in.
- Committing local/working copy
- Updating a local/working copy
- Using a keyword to check the log
- Checkout the trunk and create a branch
- Creating a branch of a branch
- Reverting an uncommitted change
- Reverting a committed change
- Merging a local/working copy
- Listing branches and then checking one out
- Text conflicts and accepting the working copy
Committing local/working copy
# check that you are in the correct copy and revision of your local/working copy of the repository fcm info # check the changes compared to the committed version of the repository. fcm st # make appropriate changes. # commit the local changes to the repository. fcm ci # confirm there are no changes in the local copy. fcm st # confirm the revision number has increased as expected. fcm info
Updating a local/working copy
fcm info fcm st # check what updates (-u) could be applied to the local/working copy. fcm st -u # if you are happy with them update your local/working copy. fcm update # check the status and commit to the repository any required changes. fcm st fcm ci
Using a keyword to check the log
# set-up your keyword. cd ~/.metomi/fcm/ # edit the keyword.cfg file, for example (using the expanded variable for $HOME): location{primary}[fcm_esIII] = file:////$HOME/fcm_tutorial/repository/essentialsIII # check the log of the local/working copy. fcm log fcm:fcm_esIII
Checkout the trunk and create a branch
# checkout the trunk with the URL. fcm co URL <LOCATION OF WORKING/LOCAL COPY> # checkout the trunk with the keyword if it is set-up. fcm co fcm:fcm_esIII_tr <LOCATION OF WORKING/LOCAL COPY> # create a branch of the trunk. fcm bc <NAME OF BRANCH> # # if you already have a local/working copy of the trunk and want to branch from # that... cd <LOCATION OF WORKING/LOCAL COPY OF TRUNK> # check it is the trunk version. fcm info # check for any updates and if you want them. fcm st -u # update if there are changes and you want them. fcm update # create a branch of the trunk. fcm bc <NAME OF BRANCH> # checkout the branch fcm co <BRANCH_URL> <LOCATION OF WORKING/LOCAL COPY OF BRANCH> cd <LOCATION OF WORKING/LOCAL COPY OF BRANCH>
Creating a branch of a branch
fcm info # if you are in the trunk and need to switch to the branch do so. fcm sw <NAME OF BRANCH> # or if you checked it out cd <LOCATION OF WORKING/LOCAL COPY OF BRANCH> fcm info fcm st # commit any changes if needed. fcm ci # check for updates from the repository. fcm st -u # update the local/working copy of needed. fcm update # now create the branch of the branch. fcm bc --bob <NAME OF BRANCH OF BRANCH> # if you want to branch from a different revision and not the HEAD. fcm bc --bob BRANCH_URL@REV <NAME OF BRANCH OF BRANCH> # either switch to the branch or check it out and move to it.
Reverting an uncommitted change
# this only works on changes in the local/working copy which have not yet been #committed to the repository. fcm st # select the local changes that you want to revert and revert them. fcm revert <FILENAME1> <FILENAME2> <DIRECTORY1> # check the changes are correct. fcm st # commit the changes if all is as required. fcm ci
Reverting a committed change
# check what revisions are available for reverting. fcm binfo # to revert changes that you have already committed fcm merge --reverse --revision M:N # check the status and commit if as required. fcm st fcm info
Merging a local/working copy
# merging a local copy branch into the trunk. # change or switch to the trunk local/working copy. fcm merge <BRANCH_URL> # accept the merge if it is correct and commit changes. fcm ci
Listing branches and then checking one out
# list possible branches fcm bls # select one to checkout fcm co <BRANCH_URL> <LOCATION OF WORKING/LOCAL COPY OF BRANCH> cd <LOCATION OF WORKING/LOCAL COPY OF BRANCH>
Text conflicts and accepting the working copy
fcm st # if it is a text conflict, e.g. # C statusesC_text.txt # not a tree conflict, e.g. # C src/utility/my_tools # we can use: fcm cf # this brings up an xxdiff three-way window. # The middle frame of the three is the common ancestor of the two. # The one on the left is the local/working copy directory that we are in, the # one considered the original. # The one on the right is the one we are trying to merge in. # Left click on the text option that we want to keep, it should change colour # from yellow to purple. # Then press "m", or use the toolbar; File -> Exit with MERGED M. [info] statusesC_text.txt: in text conflict. You merged all the changes. Run "svn resolve --accept working statusesC_text.txt"? Enter "y" or "n" (or just press <return> for "n") y Resolved conflicted state of 'statusesC_text.txt # # fcm st # if it is a tree conflict. # find out more information about the file/directory concerned. fcm log -v <FILENAME> # if you want to keep your local/working copy you # can try: fcm resolve --accept working <FILENAME> Resolved conflicted state of 'src/utility' # Please see the Text/Tree Conflicts sections in # the Specifics Tutorial for additional information, this page is only a quick # guide.
WARNING: this is a draft document it is under review awaiting approval and can be removed at any time
© British Crown Copyright 2006-16
Met Office.
This document is released under the British Open Government Licence.
This document is released under the British Open Government Licence.