setting up git repository on local machine

后端 未结 3 593
日久生厌
日久生厌 2021-02-01 07:25

How can I setup a git repository on a local system ? (I am on a windoze box)

This is the setup I am trying to achieve: (everything is on my local machine)

3条回答
  •  伪装坚强ぢ
    2021-02-01 08:05

    The difference between a "regular git" and a "bare git" is that a bare repository does not have a working directory. You should never push into a regular git repository, as you may run into problems that are hard to recover from. Always push into a bare repository.

    If you want to have a "host" where copies of your files do appear, then set up a third repository, cloning from the host one. Whenever you want to update the host files:

    • git push from your working directory to update the main repository
    • git pull from your host directory to pull from the origin

    You can even set up a post-commit hook on the bare repository to automatically do the second step.

提交回复
热议问题