git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Newbie to git

From
ESEugene Sajine <euguess@gmail.com>
Date
Dec 28, 2009, 16:51 UTC
Message-ID
<76c5b8580912280851k141bc6cev36df72b1993b8359@mail.gmail.com>
In-Reply-To
<7a0ae9cb57a1bc55653872ab254ea922@192.168.1.222>
On Mon, Dec 28, 2009 at 5:34 AM,  <mysql.jorge@decimal.pt> wrote:
Show 59 quoted lines
>> If you are addressing Andreas, why does your mail have:
>>
>>     To: <git@vger.kernel.org>
>>     Cc: <git@vger.kernel.org>
>>
>> and no other addressee???
>
> My error, sorry :)
>
>> You created "myproject1" somewhere you started "mkdir" in (perhaps in
>> $HOME?) [*1*] and that project tracks a single file "a.txt"; you are
>> correct if that was what you wanted to do.
>>
>> The new repository "myproject1" doesn't have any relation to the bare
>> repository at /home/apache/gitprojects/mydir.git/ you created earlier.
>> The next steps I recommend new people are:
>>
>>  (1) push into the public repository, by doing:
>>
>>      cd myproject1
>>      git push /home/apache/gitprojects/mydir.git/ master
>>
>>  (2) make sure push went correctly by trying to clone from there:
>>
>>      cd ..
>>      mv myproject1 myproject1.old
>>      git clone /home/apache/gitprojects/mydir.git/ myproject1
>>
>>  (3) check if the clone is what you expect
>>
>>      diff myproject1.old/a.txt myproject1/a.txt
>>
>>  (4) once satisfied, remove the old one
>>
>>      rm -fr myproject1.old
>>
>> And keep working in the myproject1 repository from there on.
>
> Thank you, i understood, i believe i really did. did that test and it's
> OK.
> But let me reask in another way:
>
> I want to setup the git server, to accept new branch's created in a remote
> place that will be push'ed to it, please correct me, 'cause i'm doing
> something wrong and i don't know what yet.
>
> - setup git server to run with:
> /usr/lib/git-core/git-daemon --reuseaddr --syslog --export-all
> --enable=receive-pack --verbose --base-path=/home/apache/gitprojects
>
> - created directory /home/apache/gitprojects
> - git init --bare /home/apache/gitprojects
>
> - what will be my link on the remote? "git://192.168.1.206" just?
> - From now on, how can I have access to push projects that exist on other
> machine?
>
> Sorry for the questions... they are newbie!
> Jorge,

Your /home/apache/gitprojects is a folder where your git repositories are supposed to be placed. Your Git repository = your project.

By running a git daemon the way you do - you say that you are going to serve all repositories from /home/apache/gitprojects.

Bare repo = repo without working copy - the one which contains only history and git objects (imagine it to be only .git folder from normal repo) Therefore for bare repos there is a naming convention so they have .git extension, while normal repo doesn't. So, myProject.git is server based bare repo, while myProject is a local repo.

Finally you have /home/apache/gitprojects/myProject.git

The URL to clone from there will be - should be shown to you by CGIT if you have everything correctly set up git://192.168.1.206/myProject.git

Hope that helps, Eugene

Previous: mysql.jorge@decimal.ptNext: Jorge Bastos
Message 9 of 12 in “Newbie to git”
  1. Jorge BastosDec 27, 2009
  2. mysql.jorge@decimal.ptDec 27, 2009
  3. Howard MillerDec 27, 2009
  4. mysql.jorge@decimal.ptDec 27, 2009
  5. Andreas SchwabDec 27, 2009
  6. mysql.jorge@decimal.ptDec 27, 2009
  7. Junio C HamanoDec 28, 2009
  8. mysql.jorge@decimal.ptDec 28, 2009
  9. Eugene SajineDec 28, 2009
  10. Jorge BastosDec 28, 2009
  11. Shantanu PavgiDec 28, 2009
  12. Jorge BastosDec 29, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.