Project

General

Profile

Downloading and modifying anniesoft packages

1) Navigate to a directory in which you have write access

cd my_directory

2) Execute one of the following commands:

git clone http://cdcvs.fnal.gov/projects/[project-name] (if you don't have developer permissions for the project yet)
git clone ssh://p-[project-name]@cdcvs.fnal.gov/cvs/projects/[project-name] (if you do)

where [project-name] = anniesoft OR lappd-response OR mcpreco OR tamora OR wchsandbox

This will create a subdirectory containing the repository contents in the current folder. It also tells git where the package is located online. You will refer to the location of the package as "origin" in future commands.

At this point there will be a local copy of the master branch in [project-name].

Modifying and updating anniesoft packages

To check changes in the local version of the package against the committed version, type:

git status

To commit changes to a file, type:

git commit -m "comments here" [filepath/filename]

To add a new file:

git add [filepath/filename]
git commit -m "comments here" [filepath/filename]

Once you've commit changes, to update the github server, you still need to type:

git push origin [branchname]

Note: you need to define the "origin" if you have not done so (see the downloading instructions above for more details).

Sparse Checkout

Under normal circumstances, sparse checkout will no longer be necessary. This allows you to download a sub-directory of a package in git. But, if you must:

Go through checkout steps 1-4 (above)

git config core.sparseCheckout true

Now you need to define which files/folders you want to actually check out. This is done by listing them in .git/info/sparse-checkout, eg:

echo "some/dir/" >> .git/info/sparse-checkout
echo "another/sub/tree" >> .git/info/sparse-checkout

Then finish with checkout step 5 (above).