Debian Codegraph @

readme/README_GIT.md

raw
1 <!----------------------------------------------------------------------------------->
2 <!--- This file is part of FreeFEM. --->
3 <!--- Laboratoire Jacques-Louis Lions --->
4 <!--- Sorbonne Université, UMR 7598, Paris, F-75005 France --->
5 <!--- --->
6 <!--- FreeFEM is free software: you can redistribute it and/or modify --->
7 <!--- it under the terms of the GNU Lesser General Public License as published by --->
8 <!--- the Free Software Foundation, either version 3 of the License, or --->
9 <!--- (at your option) any later version. --->
10 <!--- --->
11 <!--- FreeFEM is distributed in the hope that it will be useful, --->
12 <!--- but WITHOUT ANY WARRANTY; without even the implied warranty of --->
13 <!--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --->
14 <!--- GNU Lesser General Public License for more details. --->
15 <!--- --->
16 <!--- You should have received a copy of the GNU Lesser General Public License --->
17 <!--- along with FreeFEM. If not, see <http://www.gnu.org/licenses/>. --->
18 <!----------------------------------------------------------------------------------->
19
20
21 # Using git for FreeFem++ source files management
22 _april 2018_
23
24 The main difference with the previous CVS setup or mercurial is that every working
25 copy of FreeFem++ contains a complete git database of all source files
26 (in a subdirectory called `.git`).
27
28 See [git - the simple guide](http://rogerdudler.github.io/git-guide/).
29
30 ## Create a local copy of the FreeFem++ repository
31
32 ### From the web in directory ff-git
33
34 ```
35 git clone https://github.com/FreeFem/FreeFem-sources ff-git
36 ```
37
38 ## Create the ~/.gitconfig file for commit like:
39
40 Change to your own name:
41
42 ```[user]
43 name = Frederic Hecht
44 email = [email protected]
45 [push]
46 default = simple
47 ```
48
49 ## Working with a repository
50
51 All the commands below should be run from a directory of the current
52 working copy.
53
54 ### Adding a file
55
56 ```git add filename
57 ```
58
59 ### Deleting a file
60
61 ```git rm filename
62 ```
63
64 ### Deleting a file only from the Git repository
65
66 ```git rm --cached filename```
67
68 ### Commiting all local changes to the local repository
69
70 ```git commit -a -m "description of changes"```
71
72 ### Checking if there are some uncommitted local changes
73
74 ```git status```
75
76 ## Expanding changes with other repositories
77
78 ** Pulling changes from another (readable) repository
79
80 ### Pushing changes into another (writable) repository branch
81
82 ```git push origin master```
83 Change master to whatever branch you want to push your changes to.
84
85 ### Connect your repository to a remote server
86
87 ```git remote add origin <server>```
88
89 ### Create a new branch named `feature_x` and switch to it using
90
91 ```git checkout -b feature_x```
92
93 ### Switch back to master
94
95 ```git checkout master```
96
97 ### Delete the `feature_x` branch
98
99 ```git branch -d feature_x```
100
101 ### A branch is not available to others unless you push the branch
102
103 ```git push origin <branch>```
104
105 ## External developers
106
107 Developers that are not part of the official FreeFem++ team can fork
108 the FreeFem-sources repository on their GitHub account, make modifications
109 locally and submit a pull request to the FreeFem-sources repository.
110
111 # Compile FreeFem++
112
113 First to restore build file:
114
115 * use `automake` (>1.13)
116 ``` autoreconf -i```
117 * or extract build file using
118 ``` tar zxvf AutoGeneratedFile.tar.gz```
119
120 Build the Makefile:
121 ```./configure --enable-download```
122
123 Optionnaly, compile PETSc/SLEPc if needed (more than 30 min):
124
125 ```cd 3rdparty/ff-petsc
126 make petsc-slepc [SUDO=sudo]
127 ./reconfigure```
128
129 Build:
130 ```make```
131
132 Check (warning some tests fail):
133 ```make check```
134
135 Install:```sudo make install```
136 or
137 ```make install```