English 中文(简体)
曼 谷 我在一只 g子里有一根nes子?
原标题:Can I have a nested git repo inside a git-ignored folder?

我有一根 following子:

 _includes/
 _layouts/
 _plugins/
 _posts/
 _site/

可在<代码>gitignore文档中添加现场夹。

Now can I have a git repo inside _site folder with different remote repo for push and pull? Will there be any conflict?

我已经研究了甘蔗,但我认为,如果上述方法能够奏效的话,这在我看来是多余的。

最佳回答

I think it should work. For main repo, _site folder does not exists. So what you have inside it doesn t matter. When you cd into _site you will be on that independent repo.

问题回答

是——我刚刚尝试。 这里是我的指挥会议:

$ mkdir temp
$ cd temp
$ git init 
Initialized empty Git repository in /Users/mpdaugherty/temp/.git/
$ git add .
$ git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)
$ echo  ignore  >> .gitignore
$ git add .
$ git commit -a -m  first commit 
[master (root-commit) 17d293c] first commit
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore
$ mkdir ignore
$ git status
# On branch master
nothing to commit (working directory clean)
$ cd ignore
$ git init .
Initialized empty Git repository in /Users/mpdaugherty/temp/ignore/.git/
$ echo  Some text  > somefile.txt
$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   somefile.txt
nothing added to commit but untracked files present (use "git add" to track)
$ git add .
$ git commit -a -m  initial commit 
[master (root-commit) 107f980] initial commit
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 somefile.txt
$ cd ..
$ git status
# On branch master
nothing to commit (working directory clean)




相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签