I have seen a few questions similar to this around but could not figure out what I needed by them.
I set up a git repository for an iphone project I am working on. I forgot to put my storyboard related files into the .gitignore. I have now been working it for a long time and now realize my mistake.
Most posts about this say you need to go through and manually remove them from the repository and then add the storyboard files to .gitignore. Do I really have to go through and do:
rm ignoredfile1 ignoredfile2 etc...?
Isn't there some way to do all of this automatically (I believe they are all in the same directory)? I am not very familiar with the terminal so any help would be much appreciated!
Thanks!
You can use git rm --cached <files> just as you would use a usual unix rm command.
This leaves the files where they are, but removes them from the repository.
Related
So I was reading this.
And I'm a bit confuse how it's works, as I understood it:
If I only have .gitignore in my repo npm will use .gitignore but If I have both .gitignore and .npmignore npm will only read .npmignore, right? Or it will read both?
Need to know, if it's only reading .npmignore I have to copy-paste stuff from .gitignore as well.
Or it will read both
As mentioned here, it will read only the .npmignore
If you want to include something that is excluded by your .gitignore file, you can create an empty .npmignore file to override it.
Although, Jeff Dickey advocates for: "For the love of god, don’t use .npmignore"
However, what you probably don’t know is that my little action of adding the npmignore file actually causes npm to now consult that file instead of the gitignore files.
This is a major issue—I’ve now leaked all my AWS credentials out to the public just by adding this .npmignore to hide my test directory.
What’s worse is I probably have no idea this happened. npm publish doesn’t show the files that were packed (it actually does with npm 6).
I don’t see the files on the npm registry.
The only real way to see the files is by adding the package to a project and manually looking inside node_modules.
I might do that someday out of curiosity and discover my AWS credentials have been sitting out in the open for months.
Solution/safer alternative:
npm supports whitelisting though, just add a files attribute to package.json with everything you intend to add to the project.
Now only the files that are specified in files will be included in the project and your dotfiles will be ignored.
Not a Pro with Xcode, here is my problem. I have main project and Pods project. Last time it was checked in 1 year ago with older cocoapod and older Xcode.
Now I installed everything and checked in in latest Xcode with latest cocoapod. I was able to refresh pods and everything compiles and works fine. However, I do get those weird warnings. How do I clean it up and remove this from appearing?
I beleive it is related to how Pod's linking/headers used to work and how it works now. But how do I clean it up?
file:///Users/c/Documents/DMD/Pods/BuildHeaders/GoogleProtobuf/google/protobuf/io/coded_stream_inl.h: warning: Missing file: /Users/c/Documents/DMD/Pods/BuildHeaders/GoogleProtobuf/google/protobuf/io/coded_stream_inl.h is missing from working copy
I found it. I'm new to Xcode so I didn't realize what it really means. It's source-control related. I had those files checked in previously but not they are not needed and Xcode manages it but then complains that I don't have them locally but do have them in SVN. I had to commit those "deletions" and all is well.
Figured I won't delete question, maybe it will help another newbie
in terminal.
cd yourProject/Pods
then
sudo find . -type d -name .svn | xargs rm -rf
remove all svn files.
I need to switch from Composer (which is used by Symfony2 by default) to Git submodules.
I thought I could just add the desired submodules to the desired locations, thus overwriting the current version which was installed by Composer.
But when I use git submodule add, it says:
'vendor/twig/twig' already exists in the index
So I tried:
git rm vendor/twig/twig
and tried to add the submodule again, same error.
What am I doing wrong?
I'm founder and ceo of cloudControl. Currently composer does break our image building process because it interferes with the logic we have to detect submodules in some way. The team is aware of this problem and working to fix the underlying issue.
I'm working for cloudControl and we've been lately inquiring into this issue.
Regarding the original problem, you proposed already a right solution for replacing the composer packages by git submodules, it was just a git commands issue. But doing this doesn't make much sense, as long as these git submodules are identical to the Composer packages and your php code is still hanging on the autoload.php provided by Composer.
We don't process internally Composer yet, their files are just added into the repository and the php code requirements make the rest. However we do process git submodules, so if you want to make a real switch from Composer to Git Submodules, the best option is getting rid of Composer files (vendor folder and composer.* files), adding git submodules wherever you want and handling again the php dependencies . Thus everything should work fine and you'd have switched completely to git submodules.
Native support for Composer is in our future plans.
The problem was that i had to actually delete and git-remove the repository first.
i.e. for twig what i did in the end was:
git rm -r vendor/twig/*
rm -r vendor/twig/*
git add vendor/.
git submodule add git://github.com/fabpot/Twig.git vendor/twig/twig
git submodule add https://github.com/fabpot/Twig-extensions.git vendor/twig/extensions
Now i have twig and twig extensions as a git submodule and can use it in my cloud application.
I have a problem with Trac.
I cant create a new project.
Here, in the /path/to/myproject - what should I write instead of it?
In fact, my project path is: C:\Users\Programmer\BitNami Trac Stack projects
Everytime it outputs error in BitNami Trac Stack command line.
Why cant I create a new project?
It is writing: The system cannot find the path specified
Thanks!
try this:
cd C:\Users\Programmer\BitNami
trac-admin . initenv
You could save yourself a lot of hassle by avoiding blanks/spaces (and non-ASCII characters) in paths, at least if you expect to go to the command line. This always tends to become a pain.
Therefore reinstalling is a real option, because I know you can change path defaults to saner values without blanks/spaces. I did this before, and it works.
In your case to create a new project, use:
trac-admin c:/Users/Programmer/BitNami initenv
I've started using git-svn for an SVN-based project, so that I can make local commits.
However, the SVN repository contains a lot of directories that I don't need to work with. When I solely used SVN, I was able to partly check-out stuff with:
svn co <repos-url> --depth empty
and then update the needed directories:
svn up <repos-dir>/<subdir>
As far as I've understood, partly checking out a project isn't an option with Git, so I'm looking for alternative way of saving some space. Any suggestions?
Edit: what I am thinking myself is something in the lines of creating a branch thatonly contains the files I need. I'd then want to be able to push the changes to these files without pushing any removal of the files I don't need. But I am not too deply into the way Git works to figure out if this is possible?
Are the extra directories really that big? One advantage of Git is that you do most of your work from your local harddrive (you commit to your own branch, not to the server) so it's fast even when there are many files.