setting up git repository on local machine

北慕城南 提交于 2019-12-02 19:19: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.

In your client directory you have will notice a .git directory. A bare version is basically just that .git directory contents without a working copy.

Easiest thing to do would be to clone it (vs trying to setup another repository):

From c:/ call:

git clone d:/host client

This says clone the 'host' repo and store it under a folder called 'client'.

Don't create a new git repo in the client folder, clone the host repo

cd client
git clone d:/adinsert/host
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!