
Ask HN: How do you use GitHub for LaTeX documents? - ginnungagap
I recently started using github for a programming project from my university and I noticed a few people using it to host LaTeX projects as well. To the people on HN who do that, how does it work? Do you have a LaTeX editor with github support? How do you automate the process? What are your tips and tricks? (I usually write LaTeX using kile under Ubuntu 18.04, but I&#x27;m very willing to change editor if needed)
======
brudgers
My advice, learn Git from the command line. Not all of it. But at least enough
to do what you want to do...which isn't very much...set up a local repository,
connect it to a remote repository, commit, add, push, pull. There is nothing
special about LaTeX in relation to Git.

There are many git tutorials. Git Immersion
[http://gitimmersion.com/](http://gitimmersion.com/) is the one I used. Not
claiming it's the best. Just that it has a long track record, has been updated
since Jim Weirich died, and worked for me. Eight hours spread over several
days will probably be more than enough and you will learn much more Git than
you need.

The reason I recommend learning the Git command line is that it decouples
version control from editor choice. If you try a different editor a month from
now, only your editor changes. You don't have to learn how it handles
Git...that's the Unix philosophy: compose little programs that do one thing
well. All that changes is the editor part of your workflow.

The other reason I recommend "just learning the command line" is the many
times I have spent many many hours looking for the perfect tool, wading
through redundant Google search results, downloading and installing software,
learning new special programs, only to find that underlying issue remained. I
didn't understand the program I was trying to avoid learning.

~~~
ginnungagap
Thanks a lot for the tutorial link, I was actually looking for a git tutorial
because of the programming project from my university I mentioned in my
submission!

------
sgillen
I use emacs + auctex to edit and compile my latex. Then just run git manually
on my Tex and pdf files.

I think you could use just about any latex editor you want and have this
workflow work for you.

------
DivineBubba
There are Git GUI options available like SourceTree, GitHub Desktop, GitKraken
and the relatively new Sublime Merge from the makers of Sublime Text. All of
these will achieve the same thing, although I would recommend at least
learning the basics of command line Git - each to their own, though.

------
Witeshadow
I use Overleaf + github. Works well. It also supports Dropbox.

~~~
ginnungagap
I've been using overleaf for years and never realized it supports
synchronization with github! Seems very straightforward to use as well, thanks

------
lamchob
Visual Studio code, for example, has extensions for Latex. You can write the
latex src in VS Code, compile and preview it. And since VSCode also supports
git you can integrate your latex project and the repository in one workspace.

~~~
ginnungagap
I'm actually using VS Code for the Haskell project I mentioned in my
submission, so I just finished figuring out how git works with VSC, this might
be a good solution for me

------
GGfpc
When I was writing my thesis I used TexStudio and had a hook to automatically
commit and push to github every time I used Ctrl + S. This led to a bunch of
non-identifiable commits, but hey, safety first.

