Skip to main content
added 2 characters in body
Source Link
BenKoshy
  • 36.2k
  • 15
  • 120
  • 88

Main purpose of .gitignore:

  • I'm telling git: "Git, do not upload any files I list in my .gitignore file:"

Use case

  • I have unencrypted private keyse.g. unencrypted private keys- I definitely do not want upload unencrypted keys to Github. This is a good time to add those files to your .gitignore file. This means they will never be "checked in".

  • I have a lot of personal notes / scribbles in certain open source repositories: they are useful to me but not for anyone else.

  • I would not want it uploaded to github because it would simply confuse everyone who reads it. The good thing is that I can ask git to "ignore" those files.

In my case, since I don't want to pollute the open source repository with my .gitignore files, I add it to a global .gitignore file.

The only cost to this approach is that I will not be able to recover those notes if my computer crashes etc.

Main purpose of .gitignore:

  • I'm telling git: "Git, do not upload any files I list in my .gitignore file:"

Use case

  • I have unencrypted private keys - I definitely do not want upload unencrypted keys to Github. This is a good time to add those files to your .gitignore file. This means they will never be "checked in".

  • I have a lot of personal notes / scribbles in certain open source repositories: they are useful to me but not for anyone else.

  • I would not want it uploaded to github because it would simply confuse everyone who reads it. The good thing is that I can ask git to "ignore" those files.

In my case, since I don't want to pollute the open source repository with my .gitignore files, I add it to a global .gitignore file.

The only cost to this approach is that I will not be able to recover those notes if my computer crashes etc.

Main purpose of .gitignore:

  • I'm telling git: "Git, do not upload any files I list in my .gitignore file:"

Use case

  • e.g. unencrypted private keys- I definitely do not want upload unencrypted keys to Github. This is a good time to add those files to your .gitignore file. This means they will never be "checked in".

  • I have a lot of personal notes / scribbles in certain open source repositories: they are useful to me but not for anyone else.

  • I would not want it uploaded to github because it would simply confuse everyone who reads it. The good thing is that I can ask git to "ignore" those files.

In my case, since I don't want to pollute the open source repository with my .gitignore files, I add it to a global .gitignore file.

The only cost to this approach is that I will not be able to recover those notes if my computer crashes etc.

added 405 characters in body
Source Link
BenKoshy
  • 36.2k
  • 15
  • 120
  • 88

Main purpose of .gitignore – so you avoid adding irrelevant files etc. Git:

  • I'm telling git: "Git, do not upload any files I list in my .gitignore file:"

Use case

  • I have unencrypted private keys - I definitely do not want upload unencrypted keys to Github. This is a good time to add those files to your .gitignore file. This means they will never be "checked in".

  • I have a lot of personal notes / scribbles in certain open source repositories: they are useful to me but not for anyone else.

  • I would not want it uploaded to github because it would simply confuse everyone who reads it. The good thing is that I can ask git to "ignore" those files.

In my case, since I have a lot of personal notes / scribbles in certain repositories: they are usefuldon't want to me but not for anyone elsepollute the open source repository with my .gitignore files, I would not wantadd it uploaded to github because it would simply confuse everyone who read ita global . The good thing is that I can ask git to "ignore" those filesgitignore file. 

The only cost to this approach is that I will not be able to recover those notes if my computer crashes etc.

Main purpose of .gitignore – so you avoid adding irrelevant files etc. Git

I have a lot of personal notes / scribbles in certain repositories: they are useful to me but not for anyone else. I would not want it uploaded to github because it would simply confuse everyone who read it. The good thing is that I can ask git to "ignore" those files. The only cost to this approach is that I will not be able to recover those notes if my computer crashes etc.

Main purpose of .gitignore:

  • I'm telling git: "Git, do not upload any files I list in my .gitignore file:"

Use case

  • I have unencrypted private keys - I definitely do not want upload unencrypted keys to Github. This is a good time to add those files to your .gitignore file. This means they will never be "checked in".

  • I have a lot of personal notes / scribbles in certain open source repositories: they are useful to me but not for anyone else.

  • I would not want it uploaded to github because it would simply confuse everyone who reads it. The good thing is that I can ask git to "ignore" those files.

In my case, since I don't want to pollute the open source repository with my .gitignore files, I add it to a global .gitignore file. 

The only cost to this approach is that I will not be able to recover those notes if my computer crashes etc.

deleted 606 characters in body
Source Link
BenKoshy
  • 36.2k
  • 15
  • 120
  • 88

Main purpose of .gitignore – so you avoid adding your passwordsirrelevant files etc to. Git

Don’t trust your secrets on the internet

Github is on the internet. Sure, Github has security,I have a lot of personal notes / scribbles in certain repositories: they are useful to me but what if that security gets compromised? You do not for anyone else. I would not want it uploaded to undermine the entire security of your application, because you hard coded your passwords and put them on Github, andgithub because Github has their security underminedit would simply confuse everyone who read it. What thenThe good thing is the solution?

Ask Git to Ignore Certain Files

Youthat I can ask git to ignore certain"ignore" those files that are essential to the running of your application (e.g. passwords or secrets). That way, when you put your code on the internet, nothing will happen even if somebody managesThe only cost to see your code. And if you’re working on an open source project – again there are some things you simply don’t wantthis approach is that I will not be able to ‘check into git’.

Other files would do you no goodrecover those notes if you included them. e.g. precompiled assets in rails. That can be recompiled on your server with a rake task.

Anything in the .gitignore file is then ignored by Gitmy computer crashes etc. Which is what you want!

Main purpose of .gitignore – so you avoid adding your passwords etc to Git

Don’t trust your secrets on the internet

Github is on the internet. Sure, Github has security, but what if that security gets compromised? You do not want to undermine the entire security of your application, because you hard coded your passwords and put them on Github, and because Github has their security undermined. What then is the solution?

Ask Git to Ignore Certain Files

You can ask git to ignore certain files that are essential to the running of your application (e.g. passwords or secrets). That way, when you put your code on the internet, nothing will happen even if somebody manages to see your code. And if you’re working on an open source project – again there are some things you simply don’t want to ‘check into git’.

Other files would do you no good if you included them. e.g. precompiled assets in rails. That can be recompiled on your server with a rake task.

Anything in the .gitignore file is then ignored by Git. Which is what you want!

Main purpose of .gitignore – so you avoid adding irrelevant files etc. Git

I have a lot of personal notes / scribbles in certain repositories: they are useful to me but not for anyone else. I would not want it uploaded to github because it would simply confuse everyone who read it. The good thing is that I can ask git to "ignore" those files. The only cost to this approach is that I will not be able to recover those notes if my computer crashes etc.

deleted 133 characters in body
Source Link
BenKoshy
  • 36.2k
  • 15
  • 120
  • 88
Loading
added 148 characters in body
Source Link
BenKoshy
  • 36.2k
  • 15
  • 120
  • 88
Loading
Source Link
BenKoshy
  • 36.2k
  • 15
  • 120
  • 88
Loading