Joining an existing Git repository » History » Version 1

ROQUE, Damien, 01/24/2015 12:58 AM

1 1 ROQUE, Damien
h1. Joining an existing Git repository
2 1 ROQUE, Damien
3 1 ROQUE, Damien
h1. Initializing and synchronizing a Git repository
4 1 ROQUE, Damien
5 1 ROQUE, Damien
This documentation explains how to join an existing Git repository associated with a SourceForge project. For ease of use, we will assume in the following that the project identifier and the repository name are identical : @my_project@.
6 1 ROQUE, Damien
7 1 ROQUE, Damien
h2. Optional: configuring Git user identity
8 1 ROQUE, Damien
9 1 ROQUE, Damien
If you are using Git for the first time, you should first consider setting user related parameters. If already used Git on your user session, you can skip this step.
10 1 ROQUE, Damien
<pre>
11 1 ROQUE, Damien
git config --global user.name <name>
12 1 ROQUE, Damien
git config --global user.email <email>
13 1 ROQUE, Damien
git config --global push.default matching
14 1 ROQUE, Damien
</pre>
15 1 ROQUE, Damien
16 1 ROQUE, Damien
h2. Repository cloning
17 1 ROQUE, Damien
18 1 ROQUE, Damien
Create a new directory named after @my_project@ and initialize a Git structure inside it.
19 1 ROQUE, Damien
<pre>
20 1 ROQUE, Damien
git clone https://sourceforge.isae.fr/git/my_project
21 1 ROQUE, Damien
</pre>
22 1 ROQUE, Damien
23 1 ROQUE, Damien
h2. First commit and push to the remote repository
24 1 ROQUE, Damien
25 1 ROQUE, Damien
Create and add a dummy file to the repository (to be adapted to something useful).
26 1 ROQUE, Damien
<pre>
27 1 ROQUE, Damien
echo "This is a test file" > file2.txt
28 1 ROQUE, Damien
git add file2.txt
29 1 ROQUE, Damien
</pre>
30 1 ROQUE, Damien
31 1 ROQUE, Damien
Commit the changes locally and push the changes to the remote repository.
32 1 ROQUE, Damien
<pre>
33 1 ROQUE, Damien
git commit -m "A new commit including a dummy file"
34 1 ROQUE, Damien
git push
35 1 ROQUE, Damien
</pre>
36 1 ROQUE, Damien
37 1 ROQUE, Damien
h2. Updating changes from remote users
38 1 ROQUE, Damien
39 1 ROQUE, Damien
If you are collaborating with other users (or using several computers), you can update your local repository thanks to the following instruction.
40 1 ROQUE, Damien
<pre>
41 1 ROQUE, Damien
git pull
42 1 ROQUE, Damien
</pre>