- Run the following commands on the server to host the central git repository:
sudo apt-get install git
mkdir /path/to/git-root/MyProject.git
cd /path/to/git-root/MyProject.git
git init --bare --shared=group
- Run the following commands on the local computer to push the local eclipse project to the repository:
cd /path/to/workspace/MyProject
git init
echo "bin" > .gitignore
git add '*'
git add '.*'
git commit -m "Initial commit"
git remote add origin user@server.example.com:/path/to/git-root/MyProject.git
git push -u origin master
- Now other team members can check out the project from the central repository:
git clone user2@server.example.com:/path/to/git-root/MyProject.git
cd MyProject
No comments:
Post a Comment