Initializing and synchronizing a Git repository » History » Version 2

« Previous - Version 2/3 (diff) - Next » - Current version
ROQUE, Damien, 01/24/2015 12:40 AM


Initializing and synchronizing a Git repository

This documentation explains how to create a Git repository synchronized with a SurceForge project. For ease of use, we will assume in the following that the project identifier and the repository name are identical : my_project.

Repository initialization and remote configuration

Create a new directory named after my_project and initialize a Git structure inside it.

mkdir my_project
cd my_project
git init

Connect the local repository to the remote SourceForge, this links is named origin.

git remote add origin https://sourceforge.isae.fr/git/my_project

First commit and push to the remote repository

Create and add a dummy file to the repository (to be adapted to something useful).

echo "This is a test file" > file1.txt
git add file1.txt

Commit the changes locally and push the changes to the remote repository.

git commit -m "My first commit including a dummy file" 
git push origin master

Notice that the last instruction can be abbreviated by git push if the remote identifier and branch are set as default.
git push --set-upstream origin master