Maintaining a local git repository from a source tarball
Tags git, no internet, openfoam, tarball, without internet
Here is the scenario: You need the latest OpenFOAM 1.7.x git version, but your Linux machine is stranded on a deserted lab without access to the internet or to any other machine that does have access to the internet. The only machine with internet access that you have access to, is on some other place in the world and on top of that, uses Windows for an operating system. And you think to yourself: "I'm doomed... so very doomed... "
Fear not, because:
Although, you might want to have a metal plate in the end of your shoe
NOTE: Mark Olsen has already something very similar some time ago here: OpenFOAM 1.7.x git problem - post #15. But it requires that you are already using a Linux machine for getting the repository, where you would have a strange issue with the firewall+github.
These instructions are for a tarball based git repository of OpenFOAM 1.7.x - here's what you can do:
Any other questions about git, read the tutorials and learn:
Bruno
References:
Fear not, because:
Quote:
Originally Posted by Pauline Kael
Where there is a will, there is a way. If there is a chance in a million that you can do something, anything, to keep what you want from ending, do it. Pry the door open or, if need be, wedge your foot in that door and keep it open.
NOTE: Mark Olsen has already something very similar some time ago here: OpenFOAM 1.7.x git problem - post #15. But it requires that you are already using a Linux machine for getting the repository, where you would have a strange issue with the firewall+github.
These instructions are for a tarball based git repository of OpenFOAM 1.7.x - here's what you can do:
- Download the source tarball in tar.gz format: it's this link here
This is a snapshot of the latest commit into the OpenFOAM 1.7.x git version. This will be completely stripped of the git history of the commits, since it's just a snapshot of the file tree of the latest commit. - Copy the tarball to your Linux system.
- Create a folder for source development, where you will keep a clean version of your local git repository. For example: "$HOME/OpenFOAM-git"
- Unpack the tarball in that folder. In my case, I ran:Code:
tar -xzf OpenCFD-OpenFOAM-1.7.x-version-1.7.1-167-gc7eaf52.tar.gz
... so, rename it to OpenFOAM-1.7.x:Code:mv OpenCFD-OpenFOAM-1.7.x-version-1.7.1-167-gc7eaf52 OpenFOAM-1.7.x
- Now, cd into that folder and run:Code:
git init git add . git commit
Code:Source: OpenCFD-OpenFOAM-1.7.x-version-1.7.1-167-gc7eaf52.tar.gz
And voilá, your local git repository is now ready to be used. - Now, go to your folder where you will use OpenFOAM for building and working with it, e.g.: $HOME/OpenFOAM
- Run:Code:
git clone $HOME/OpenFOAM-git/OpenFOAM-1.7.x OpenFOAM-1.7.x
- Same as point 1 of the previous list.
- Same as point 2 of the previous list.
- Got to your local repository:Code:
cd $HOME/OpenFOAM-git/OpenFOAM-1.7.x
- Unpack the new tarball like this:Code:
tar --strip 1 -xzf ../OpenCFD-OpenFOAM-1.7.x-version-1.7.1-167-gc7eaf52.tar.gz
- Run:Code:
git add . git commit
- Now, go into your working folder:Code:
cd $HOME/OpenFOAM/OpenFOAM-1.7.x
- Run:Code:
git pull
Any other questions about git, read the tutorials and learn:
- official git tutorial
- Mark Olsen's blog: Getting started with OpenFOAM and git
Bruno
References:
- The initial idea come from this thread: OpenFOAM 1.7.x git problem - post #12 is where I suggested doing it from the tarball
- Firstly wrote these instructions on this thread post:Update 1.7.x from local source - post #7
Total Comments 0