Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Wednesday, October 20, 2010

LaTeX and git

Hi,

Some of you may remember our discussion at dinner about using git/SVN with LaTeX documents. One of the problems that was mentioned was line-based diff - whenever the formatting of the paragraph changes all of the lines are marked as modified, even if the content did not change.

* git diff --color-words

I found very nice solution to the problem: in git diff you can use the option --color-words which performs word-based diff and highlights the changes in colors.

* gitattributes

You can also put the following line into your .gitattributes file:

*.tex diff=tex

which treats some tags (likes \section{}) as separate words even if there is no whitespace in between.

I am almost converted to git - thanks for opening my eyes ;)

Cheers,

Bartek

Tuesday, October 5, 2010

Git & github getting started

Global setup:

Download and install Git
git config --global user.name "Your Name"
git config --global user.email eilif@gmx.de


Next steps:

mkdir test
cd test
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@github.com:markovg/test.git
git push origin master


Existing Git Repo?

cd existing_git_repo
git remote add origin git@github.com:markovg/test.git
git push origin master


Importing a Subversion Repo?

Click here


When you're done:

Continue