forked from ransford/pdflatex-makefile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README-GIT
56 lines (43 loc) · 1.64 KB
/
README-GIT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
If your LaTeX document is in a Git repository, you can track
pdflatex-makefile as a submodule to stay up to date (and avoid having to
symlink to Makefile.include):
$ git submodule add \
git://github.com/ransford/pdflatex-makefile.git pdflatex-makefile
Your repository will now contain a 'pdflatex-makefile' subdirectory that is
a pointer to the pdflatex-makefile repository.
$ git submodule status
-3b8720873263445ff168ad077edc14aafb058cc6 pdflatex-makefile
Add and push this pointer to your own repository:
$ git add .gitmodules
$ git add pdflatex-makefile
$ git commit -m 'added pdflatex-makefile submodule'
$ git push
Then your collaborators can populate the pdflatex-makefile subdirectory on
their own clones:
$ git pull
$ git submodule init
$ git submodule update
Or you can have the Makefile do those steps for them if necessary, by
insisting that they run a 'make setup' step:
$ cat Makefile
TARGET = mypaper
# check whether pdflatex-makefile submodule is initialized
ifneq ($(wildcard pdflatex-makefile/Makefile.include),)
include pdflatex-makefile/Makefile.include
else
##### begin submodule-initialization targets
.PHONY: all
all:
@echo Run 'make setup' and then 'make' again.
setup:
cd "$(shell git rev-parse --show-toplevel)" && git submodule init \
&& git submodule update
##### end submodule action
endif
Every once in a while, update your pdflatex-makefile pointer to the latest
version:
$ cd pdflatex-makefile
$ git pull
$ cd ..
$ git commit -m 'updated pdflatex-makefile submodule' pdflatex-makefile
Help on submodules: http://progit.org/book/ch6-6.html