VS2013 with GitHub - Stop JS files from typescript files from commits

I am using Visual Studio 2013 and GitHub for my source control, and the problem I save is that it is trying to commit all .js files that are generated from .ts (Typescript) files.

The reason this is bad is because I had an experience in which these reasons cause crashes, and only closing and reopening Visual Studio fixes the problems.

My git knowledge is still rudimentary, but it seems to me that this should be a common problem. I do not want to simply exclude all .js files, because there are many that are not generated from typescript; So what can I do with this other than MANUALLY, excluding files every time I commit?

+7
github visual-studio
source share
2 answers

Add some file templates to one of the Git ignore files.

  • The .gitignore file .gitignore usually transferred with the repository, so ignoring it is used by all users.
  • The .git/info/exclude file is not transferred to the repository, so it can be used for your own personal ignores.

To ignore the entire .js file in the foo directory, use something like this:

 foo/*.js 

Note that patterns in ignore files prevent file tracking. This means that if you have already made a file, it will continue to be tracked . The changes will cause the file to appear in your "uncommitted changes", and something like git commit -a will commit the changes.

If you have a dedicated file that you want to ignore in the future, you will have to remove it from the repository. This is a common question about SO, and there are many questions about it.

It is worth reading the Git function to ignore, as it has several fixes.

+8
source share

This feature request is: http://github.com/TypeStrong/atom-typescript/issues/253

I have currently used

  • rename file, ex, myfile.ts.ts
  • include in my .gitignore my auto- *.ts.js typescript *.ts.js and *.ts.js.map
+2
source share

All Articles