User:Timothee Flutre/Notebook/Postdoc/2012/08/14: Difference between revisions
From OpenWetWare
(→About Git: add tip) |
(→About Git: add tips about ssh tunnel and local branch which tracks remote one) |
||
Line 26: | Line 26: | ||
** undo uncommitted changes: <code>git checkout myfile.txt</code> | ** undo uncommitted changes: <code>git checkout myfile.txt</code> | ||
** split a big commit in several smaller commits: <code>git add -p myfile.txt</code> | ** split a big commit in several smaller commits: <code>git add -p myfile.txt</code> | ||
** usual config: <code>git config --global user.name 'Timothée Flutre'; git config --global user.email 'timflutre@gmail.com'; git config --global i18n.commitEncoding 'utf8'; git config --global i18n.logOutputEncoding 'utf8'</code> | ** usual config: <code>git config --global user.name 'Timothée Flutre'; git config --global user.email 'timflutre@gmail.com'; git config --global core.editor emacs; git config --global i18n.commitEncoding 'utf8'; git config --global i18n.logOutputEncoding 'utf8'</code> | ||
** remote via ssh tunnel: first open the tunnel <code>ssh gateway.foo.bar -l tflutre -Nf -L 20400:maincluster:22</code>, then add the remote <code>git remote add mcl ssh://tflutre@localhost:20400/home/tflutre/myproject/.git</code> | |||
Line 68: | Line 69: | ||
rm -f *~ *.aux *.dvi *.log *.pdf *.bbl *.blg *.toc | rm -f *~ *.aux *.dvi *.log *.pdf *.bbl *.blg *.toc | ||
</nowiki> | </nowiki> | ||
* '''Two remotes''': let's imagine that on cluster1 I have 2 branches, "master" and "dev", on github I only have "master", and I want to work with "dev" on cluster2. | |||
** first I log on cluster2 and I clone the repo from github: <code>git clone https://github.com/timflutre/myproject.git</code> | |||
** then I add my repo from cluster1 as a remote: <code>cd myproject/; git remote add cluster1 ssh://tflutre@cluster1:/home/tflutre/myproject/.git</code> | |||
** finally I fetch the remotes and create a "dev" branch which tracks the one on cluster1: <code>git remote update; git checkout -b dev cluster1/dev</code> | |||
<!-- ##### DO NOT edit below this line unless you know what you are doing. ##### --> | <!-- ##### DO NOT edit below this line unless you know what you are doing. ##### --> |
Revision as of 19:16, 10 April 2013
Project name | <html><img src="/images/9/94/Report.png" border="0" /></html> Main project page <html><img src="/images/c/c3/Resultset_previous.png" border="0" /></html>Previous entry<html> </html>Next entry<html><img src="/images/5/5c/Resultset_next.png" border="0" /></html> |
About Git
all: main supp main: latex paper_main.tex bibtex paper_main latex paper_main.tex latex paper_main.tex pdflatex paper_main supp: latex paper_supplements.tex bibtex paper_supplements latex paper_supplements.tex latex paper_supplements.tex pdflatex paper_supplements clean: rm -f *~ *.aux *.dvi *.log *.pdf *.bbl *.blg *.toc
|