Cloning a git repository from blastula
Jump to navigation
Jump to search
Location of repositories
Note that all repositories are located in /labcommon/manulabrepos.
You will need to clone repositories if:
- you'd like to use or contribute to some code in an existing repository or
- you've just created a bare repository in
/labcommon/manulabreposand would like to add files to it.
The steps
- Create a directory in your home directory on our machines or your laptop where you will keep the repository and set as working directory
mkdir <local_repo_name>
cd gitmine
- Clone
git clone ssh://<username>@blastula.biol.und.edu/labcommon/manulabrepos/<reponame>.git .
- Substitute your username for
<username>and the repository name for<reponame>. For permission reasons, you must connect to blastula (which hosts labcommon) and no other computer. The default name for the remote repository is "origin". If you'd like a different name (perhaps because you have more than one remotes for the same repository) you can use --origin:
git clone --origin <remotename> ssh://<username>@blastula.biol.und.edu/labcommon/manulabrepos/<reponame>.git .
Populating a bare repository
In your local respository create or copy over the files to be versioned. Add them to git tracking, commit, and then push or "publish" your changes to the remote.
- Create/copy new files to be versioned. For example:
touch README.md
- Tell git to version them
git add README.md
- Commit the changes
git commit -m "First commit!"
- At this point your local repository has advanced, but not the remote. To update/push to/publish to the remote, use git push
git push