Jump to content

Git repository on this server: Difference between revisions

From HW wiki
No edit summary
No edit summary
Line 1: Line 1:
After a repository is created here for you by the admin, follow these instructions:
After a repository is created here for you by the admin, follow these instructions:


* [[Git#Install_Git|Install Git]]
* Optional: Setup [[Passwordless_SSH|passwordless login to the server]]
* Optional: Fill in the description of the project for [http://rtime.felk.cvut.cz/gitweb/ GitWeb interface] &ndash; edit the file <tt>/var/git/''repo-name''.git/description</tt> on the server.
* [[Git#Install_Git|Install Git]] on your local computer
* Put your sources to your local repository
* Put your sources to your local repository
  cd your/project
  cd your/project
  git init
  git init             # initializes git repository in your project's directory
  git add .
  git add .             # tells git to track all files in your project
  git commit
  git commit           # commits the added files to the repository
* Then "connect" your repository to the one on this server (replace ''login'' by your login and and ''repo-name'' by the name of repository created for you)
* Then "connect" your repository to the one on this server (replace ''login'' by your login and and ''repo-name'' by the name of repository created for you)
  git remote add origin ''login''@rtime.felk.cvut.cz:/var/git/''repo-name''.git
  git remote add origin ''login''@rtime.felk.cvut.cz:/var/git/''repo-name''.git

Revision as of 13:58, 25 July 2008

After a repository is created here for you by the admin, follow these instructions:

cd your/project
git init              # initializes git repository in your project's directory
git add .             # tells git to track all files in your project
git commit            # commits the added files to the repository
  • Then "connect" your repository to the one on this server (replace login by your login and and repo-name by the name of repository created for you)
git remote add origin login@rtime.felk.cvut.cz:/var/git/repo-name.git
git config branch.master.remote origin
git config branch.master.merge refs/heads/master
  • Push your sources to the server
git push --all

For other hints refer to the git documentation or to this page.