Git (Was: can't get includes to load) [message #180944 is a reply to message #180943] |
Thu, 28 March 2013 08:34 |
J.O. Aho
Messages: 194 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 28/03/13 08:41, Cal Dershowitz wrote:
> On 03/28/2013 12:17 AM, Cal Dershowitz wrote:
>> On 03/27/2013 03:00 AM, J.O. Aho wrote:
<renamed topic as it's now more of git than anything else and really off
topic to for this news group>
> snip
>> Now did it take a snapshot all the way up the directory tree?
>>
>> The directories there with url-sounding names were the results of wget
>> commands. I don't need them anymore. How would I go about deleting
>> them and them bringing them back to life with git just for practice?
>>> I would ditch the php2, no use of it, all work you do should origin from
>>> what you have live. Don't forget to create a new branch when you start
>>> to work with something, when you put something live, you merge that
>>> branch to master branch. So master should always be what you have in
>>> live, other branches are for what you are working on or testing.
>>>
>>
>> I understand somewhat and simply need to practice. Thanks for your
>> very-useful comments.
>
> I tried to do what falf did in the tutorial, but I seem not to get at
> all what files git is working on. Where does the resulting "git-file"
> end up?
after you run "git init" there will be a .git directory in the directory
where you did the "git init" in.
Everything about the repository is stored there. If you want to remove
the git repository once and for all, then just delete the directory
(keep in mind you loose all the history and will end up with the files
which you have checked out).
> $ pwd
> /home/sites/migrate/php/php1
> $ ls
> includes index.php readme.txt readme.txt~ style.css
> $ git add readme.txt
> $ git status
> # On branch master
> #
> # Initial commit
> #
> # Changes to be committed:
> # (use "git rm --cached <file>..." to unstage)
> #
> # new file: readme.txt
> #
> # Untracked files:
> # (use "git add <file>..." to include in what will be committed)
> #
> # ../../../.jonathan.txt.swp
> # ../../../j2.txt
> # ../../../jonathan.txt
> # ../../bash3.sh
> # ../../cleaning/
> # ../../cp_1.pl
> # ../../dog/
> # ../../food/
> # ../../fredify2.sh
> # ../../git1.txt
> # ../../git1.txt~
> # ../../includes/
> # ../../index.php
> # ../../melancholia/
> # ../../micah/
> # ../../migrate_ftp1.pl
> # ../../music1.pl
> # ../../music2.pl
> # ../../nikon_bash1.sh
> # ../../nikon_bash2.sh
> # ../../nikon_bash3.sh
> # ../../nikon_bash4.sh
> # includes/
> # index.php
> # readme.txt~
> # style.css
> # ../../php1.sh
> # ../../phpini.sh
> # ../../reg1.pl
> # ../../reg2.pl
> # ../../reg2.pl.bak
> # ../../sos/
> # ../../style.css
> # ../../variables/
> # ../../../www.nmlutherhaven.com/
> # ../../../www.sttimschurch.net/
> $
>
> So what now? Since this
> /home/sites/migrate/php/php1
> is the directory I *really* want to have this capability in, should I do
> the git init there?
You shouldn't have a git inside a git. Remove the /home/sites/.git first
and then create a new git in the directory /home/sites/migrate/php/php1
rm -rf /home/sites/.git
cd /home/sites/migrate/php/php1
git init
git add .
git commit -m "Initial commit for php1 which has a quite bad name"
Now you would have the git for only the php1 directory. I do opt you to
have better naming for your directories and files.
> I do want to keep the php directory in this because of the way I process
> images. I want to have a vacant parent directory, where I put all the
> images and then store them in some subdirectory.
git allows you to version handle images too, if you want, it's not
limited to source files, of course a diff between two version of an
image will not give you anything of value, just the possibility to
revert to the old image.
--
//Aho
|
|
|