I have added the .idea files to my .gitignore file and that seems to work fine. Since my .idea files were tracked already, though, earlier posts have suggested the following code, to get them out from under version control.
git rm -rf .idea
or
git rm -r --cached .idea
In either case, though, I get the message:
fatal: pathspec '.idea' did not match any files.
When I list my files in this folder, though, .idea is right up top.
What am I doing wrong?
fatal: pathspec '.idea' did not match any files.
assuming there would be no file with the name .idea on the path
Since you are trying to remove the entire folder change your command
git rm -r --cached .idea
to
git rm -r --cached .idea/
Related
So I recently uploaded my react-native project on GitHub, then cloned it back to see how it will build(did it for first time... yeah). And on react-native run-ios I got a repetitive error: "react-native-app/ios/Pods/Target Support Files/Pods-testAppTests/Pods-testAppTests.debug.xcconfig: unable to open file (in target "testAppTests" in project "testApp") (in target 'testAppTests' from project 'testApp')
I found a solution, where this:
cd ios
pod deintegrate
pod install
helped me as the project then built and ran correctly.
So my question is, how to upload it to GitHub in a way so it builds always correctly after cloning it?
Update
Checking and editing .gitignore solved this problem.
Maybe this is linked to files which have been added/committed, while they should have been ignored, private and local only (not uploaded to GitHub)
Check your .gitignore: here is one for ReactNative, as explained in "Creating a .gitignore for a Clean React Repository", blog post written by Parker Johansen.
Then, assuming you don't have any pending changes/work in progress, you can, as explained here, apply your new .gitignore to your existing repository:
cd /path/to/local/cloned/repo
# create your .gitignore
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
git push
Finally, clone it again, and see if it compiles better.
The OP adds in the comments:
I found that folder 'Pods' doesn't exist on GitHub, that's why this error occurs, how can I add it to my /ios folder on Github correctly
I advise to check if there is a .gitignore rule which would ignore said folder:
git check-ignore -v Pods/aFile_inside_Pods
I'm trying to find the location of nvm file.
I want to remove it, and I want to reinstall it.
I have faced a problem with finding the location of nvm file
logos1056#logos1056-Vostro-3578:~$ nvm ls
N/A
node -> stable (-> N/A) (default)
iojs -> N/A (default)
logos1056#logos1056-Vostro-3578:~$ rmdir $NVM_DIR
rmdir: failed to remove '/home/logos1056/.nvm': Directory not empty
logos1056#logos1056-Vostro-3578:~$ /home/logos1056/.nvm
bash: /home/logos1056/.nvm: Is a directory
logos1056#logos1056-Vostro-3578:~$ cd /home/logos1056/.nvm
logos1056#logos1056-Vostro-3578:~/.nvm$ rmdir $NVM_DIR
rmdir: failed to remove '/home/logos1056/.nvm': Directory not empty
nvm is usually installed in your home directory within a hidden folder called .nvm.
$NVM_DIR is the environment variable that contains the path to nvm.
You want to remove the directory and all its content. You can do it this way.
$ rm -rf $NVM_DIR
Then you can install nvm again.
Oneliner,
rm -rf $NVM_DIR ~/.npm ~/.bower
My yarn.lock file looks like:
package#x.x.x:
version: "x.x.x"
resolved: "http://registry.yarnpkg.com/package/-/xxxx"
But the CI is in intranet and the registry is http://99.12.xx.xx/xxx
How to use intranet registry in CI build regardless of the internet registry in the yarn.lock file?
This is an old issue on yarn's github repository as you can see here
I solved this issue by running a sed command to substitute the registry link before installing packages:
sed -i -e "s#https://registry.yarnpkg.com/#{YOUR_CI_REGISTRY}#g" yarn.lock
hope that helps.
To save actual dependencies you can remove a resolved directive from the yarn.lock file, set your repository and renew yarn.lock by yarn install
sed -i -e "/resolved:* .*$/d" yarn.lock
yarn config set registry <YOUR_REGISTRY>
yarn install
To prevent yarn.lock break by other developer you can also file a your registry setting into .yarnrc
.yarnrc
registry "<YOUR_REGISTRY>"
I accidentally created a symbolic link of sites-available inside sites-enabled. Now, I don't know what happened but I did a rm -rf sites-available to delete the symbolic link, but that is not what happened. Instead, all my configuration files inside sites-available was deleted. The worst is the symbolick link of sites-available is still inside the sites-enabled. I tried rm -f sites-available but it won't delete it. How can I get rid of this?
Have you changed directory to sites-enabled, if you want to remove symlink then change directory to correct path:
cd path/sites-enabled
and then remove sites-available, but first make sure no longer you need it.
rm -vf sites-available
Note the difference between
rm -rf symboliclink
and
rm -rf symboliclink/
I recently started using git-svn, and tried to tell Git to ignore any files that the Subversion repo ignores (mostly binaries and object files), by running "git svn show-ignore >> .gitignore"
Then I ran git status, and saw that many of those files that are now on my .gitignore list, are still showing up under "untracked files". Why? What do I need to do to fix this?
Or am I going about this the wrong way? I just want to be able to run "git add ." without it adding in all that junk to the commit.
Thanks.
If you already imported those files in the Git repo, they won't be ignored until you git rm --cached them.
You need to remove those file from the Git index (hence the --cached option), before seeing the .gitignore working.