3

I want to have a server and client projects in the same repository.
After finishing backend I cloned a boilerplate(client) for the frontend from another repository. It is in the same level as src.
After pushing it to github I can see a white arrow in client folder, and can't open. Following the steps in this link I removed .git from client folder. But when I do

git add client

or

git add . 
git commit -m "commit"

it says that

husky > pre-commit (node v10.16.0)
i No staged files found.
On branch features
nothing to commit, working tree clean

What am I doing wrong?

Robert Christopher
  • 4,940
  • 1
  • 20
  • 21
Greg
  • 255
  • 2
  • 8
  • 19

2 Answers2

9

You should first do:

git rm --cached client      # no trailing slash
git commit -m "remove client gitlink"

Than you can try and add client/ again, which, since it has no .git subfolder, should include its files content.

Note that, as illustrate in okonet/lint-staged issue 682 and its README

If you wish to use lint-staged in a multi package monorepo, it is recommended to install husky in the root package.json.

Check also your husky configuration, as in here.


I've ".gitignore" file in client folder. Can it affect on this issue?

If nothing is added, you can check if that is because of any ignore rule with:

git check-ignore -v -- client/aFile_that_should_be_added
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • thanks for answer. Actually I've tried it as well. But it didn't work, it says "fatal: pathspec 'client' did not match any files" – Greg Oct 11 '20 at 14:50
  • @Greg Do yu have the link of your GitHub repository? – VonC Oct 11 '20 at 14:52
  • Hi @VonC. Unfortunately it's a private from the company I am studying. But I can provide any info you want. – Greg Oct 11 '20 at 14:56
  • @Greg If you still have the gitlink (white arrow folder) on the remote GitHub repo, can you clone it back to a different local folder, and try the `git rm --cached client` there? (Plus commit and push) – VonC Oct 11 '20 at 14:58
  • Hi @VonC I still have it. Actually cloned the whole repo, but the client folder didn't appear. – Greg Oct 11 '20 at 15:05
  • @Greg In that new clone repo, can you copy your client folder (without its .git subfolder) and try your add and commit there? A push should this time push the client folder content. – VonC Oct 11 '20 at 15:09
  • Hi @VonC I'm already doing. In the meantime one question please. I've "gitingnore" file in client folder. Can it affect on this issue? – Greg Oct 11 '20 at 15:24
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/222861/discussion-between-vonc-and-greg). – VonC Oct 11 '20 at 15:27
0

People of the internet, I found a pretty simple solution to the problem. make sure you have a parent folder and all other folders need to be children inside that one. I was getting a white arrow on my folders and deleting the .git did not work, but putting a parent folder solved the problem in both my projects. Also for those having issues with uploading to github, here is the best article : https://www.tutsmake.com/upload-project-files-on-github-using-command-line/, make sure to change the URL in step 6.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 03 '22 at 19:03