{"id":19682,"date":"2020-11-01T19:00:16","date_gmt":"2020-11-02T03:00:16","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=19682"},"modified":"2023-12-01T04:03:31","modified_gmt":"2023-12-01T12:03:31","slug":"gitignore","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/gitignore\/","title":{"rendered":".gitignore Files: A Guide for Beginners"},"content":{"rendered":"\n<p>.gitignore files contain a list of files Git should ignore in a local project. A .gitignore file commonly appears in the main directory of a project. You can ignore single files, multiple files, or folders.<\/p>\n\n\n\n<p>You may have files that you do not want to include in the main version of your <a href=\"https:\/\/careerkarma.com\/blog\/what-is-git\/\">Git repository<\/a>. These files may contain configurations or local variables that are private and should not be seen by other collaborators. <\/p>\n\n\n\n<p>That\u2019s where the .gitignore file comes in. This file allows you to instruct Git to ignore files. <\/p>\n\n\n\n<p>In this guide, we\u2019re going to talk about what .gitignore is, how it works, and how you can write your own .gitignore file. Without further ado, let\u2019s get started!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is a .gitignore File?<\/h2>\n\n\n\n<p>A .gitignore file lists the files which Git will ignore. .gitignore files usually appear in the root directory of a project. Files tracked by Git are not ignored unless you remove them from a project.<\/p>\n\n\n\n<p>Git when you add them to a commit. This means that every file, including configuration files and compiled code, will be added to a commit if you use the * operator. This operator stages all files into a commit. <\/p>\n\n\n\n<p>Often, developers want to ignore output folders, hidden system files, and compiled code. For instance, if you have a .env file in a repository, you may want to hide it. This is because .env files usually contain API keys which you may not want to commit to a repository. <\/p>\n\n\n\n<p>There is no ignore command you can use to ignore files. You need to make a list of all the files that you want to ignore in the .gitignore file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Write a .gitignore File<\/h2>\n\n\n\n<p>Creating a <em>.gitignore<\/em> file is simple. Open up a command shell and create a text file called <em>.gitignore<\/em> in the root directory of a project. You can do this using the touch command: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>touch .gitignore<\/pre><\/div>\n\n\n\n<p>We&#8217;ve created a .gitignore file. We do not need to set up our file with any configuration settings. Our next step is to add a list of the files we want to ignore. These files become untracked files, which is another word to describe a file ignored Git in a local repository. <\/p>\n\n\n\n<p>Consider the following <em>.gitignore<\/em> file: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>node_modules\/\n.env\n<\/pre><\/div>\n\n\n\n<p>This file ignores two resources: all files in the node_modules directory and the .env file. We&#8217;ve ignored two specific resources in our local repository: a folder and a file. <\/p>\n\n\n\n<p>This is a common setup with JavaScript projects. node_modules contains the local copy of all the dependencies you are using for a project. It would be impractical to commit this to a repository when you can just install these dependencies yourself. The .env file contains API keys. It is bad practice to share API keys in a repository to which many people have access. <\/p>\n\n\n\n<p>Let\u2019s say that we want to ignore multiple files or directories. We can do this by using the * wildcard. <\/p>\n\n\n\n<p>Let\u2019s ignore all .pyc files in a repository:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>*.pyc<\/pre><\/div>\n\n\n\n<p>All files whose name patterns match *.pyc are ignored. The asterisk is the wildcard operator.<\/p>\n\n\n\n<p>GitHub has created an excellent collection of gitignore files that you can use on their site. <a href=\"https:\/\/github.com\/github\/gitignore\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\">View GitHub\u2019s collection of gitignore files<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using Multiple .gitignore Files<\/h2>\n\n\n\n<p>You can use multiple .gitignore files in the same repository. This works because .gitignore is relative to the directory in which it is placed. <\/p>\n\n\n\n<p>In our last example, we placed .gitignore in the root directory of our project. Let\u2019s say that we want to ignore all the files that end in .pyc in the diff\/ folder. We could do this by creating a file called .gitignore in the diff folder using the command line: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>touch diff\/.gitignore<\/pre><\/div>\n\n\n\n<p>We would add the following rule to the .gitignore file:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>*.pyc<\/pre><\/div>\n\n\n\n<p>When we go to commit code to our repository, Git will ignore any file in the diff\/ folder which ends in .pyc. <\/p>\n\n\n\n<p>This setup is best when you only need rules to apply to certain folders within a project. However, it can be confusing to have multiple .gitignore files in one project. An alternative is to be more specific when you state which files your project should ignore. If you are specific, you can keep all your rules in one .gitignore file. Consider this file: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>*.txt\ndiff\/*.pyc<\/pre><\/div>\n\n\n\n<p>This .gitignore is in the root directory of a Git project. It instructs Git to ignore all files ending in .txt in the project. It also instructs Git to ignore all files ending in .pyc which are in the diff\/ folder.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Create a Global Git Ignore Rule<\/h2>\n\n\n\n<p>It can be time-consuming to define a .gitignore file for every project you create. What\u2019s more, you\u2019ll usually find that most of your projects use the same set of .gitignore rules. <\/p>\n\n\n\n<p>You can set a global git ignore rule which will automatically set the gitignore rules for every repository on your system. This file is usually placed in your home directory of your operating system, such as <em>\/home\/your_username<\/em> or <em>\/Users\/your_username<\/em>. <\/p>\n\n\n\n<p>Let\u2019s create a global .gitignore file: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>touch ~\/.gitignore<\/pre><\/div>\n\n\n\n<p>This command creates an empty .gitignore file in our home directory. Open up this file and add in whatever rules you want to set for all the Git repositories on your system. <\/p>\n\n\n\n<p>Once you have configured your gitignore file, you can enforce its rules using the <em>core.excludesFile<\/em> property: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>git config --global core.excludesFile ~\/.gitignore<\/pre><\/div>\n\n\n\n<p>This command sets the rules in the <em>~\/.gitignore<\/em> file to apply to all Git repositories on a computer. <\/p>\n\n\n\n<p>Be careful when you are defining a global git ignore rule. This is because the rules in a global .gitignore are set by default across all projects. <\/p>\n\n\n\n<p>A global .gitignore file is best used for common files like .env which you will almost never want to commit to a git repository.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Ignore a Committed File<\/h2>\n\n\n\n<p>You cannot always anticipate which files you will want to ignore in a project. It may be the case that you have previously committed a file to a repository but now you want to ignore it. <\/p>\n\n\n\n<p>Let\u2019s ignore the file <em>config.json. <\/em>This file is already committed to our repository. We should start by adding an ignore rule to our <em>.gitignore<\/em> file: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>echo config.json &gt;&gt; .gitignore<\/pre><\/div>\n\n\n\n<p>This command appends <em>config.json<\/em> to the end of our .gitignore file. Now we have to remove the file from our repository. We can do this using the git rm \u2013cached command. This command will only remove a file from your repository. It will remain a local file on your computer. <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>git rm --cached config.json<\/pre><\/div>\n\n\n\n<p>Next time we create a commit, the config.json file will be ignored.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Commit an Ignored File<\/h2>\n\n\n\n<p>You can commit a file that has been ignored in your .gitignore file. <\/p>\n\n\n\n<p>This may be useful if you are creating default config files that you want to commit to a repository that would otherwise be ignored. You can commit an ignored file using the -f flag when you are adding a file to the staging area: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>git add -f config.json\ngit commit -m &quot;feat: Create default config file&quot;<\/pre><\/div>\n\n\n\n<p>This code adds the file config.json to the staging area. It then creates a commit based on the contents of the staging area. You can learn more about the git add in our <a href=\"https:\/\/careerkarma.com\/blog\/git-add\/\">git add tutorial<\/a>. You can read about the git commit command in our <a href=\"https:\/\/careerkarma.com\/blog\/git-commit\/\">git commit tutorial<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The .gitignore file allows you to ignore files in a Git repository. <\/p>\n\n\n\n<p>You may not want to include all the files in your local copy of a project in your commits. For instance, you may not want to commit compiled code, or system logs, or config files. To ignore files, you can specify which ones you want to ignore in .gitignore. <\/p>\n\n\n\n<p>A project can contain multiple <em>.gitignore<\/em> files. You can override a .gitignore rule using the -f flag when you use the git add command. <\/p>\n\n\n\n<p>Now you\u2019re ready to use the .gitignore file like an expert! <\/p>\n","protected":false},"excerpt":{"rendered":".gitignore files contain a list of files Git should ignore in a local project. A .gitignore file commonly appears in the main directory of a project. You can ignore single files, multiple files, or folders. You may have files that you do not want to include in the main version of your Git repository. These&hellip;","protected":false},"author":240,"featured_media":19773,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17286],"tags":[],"class_list":{"0":"post-19682","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-git"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"Git","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>.gitignore Files: A Guide for Beginners | Career Karma<\/title>\n<meta name=\"description\" content=\"A .gitignore file allows you to exclude files from your git commits. On Career Karma, learn how to write and use .gitignore files.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/gitignore\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\".gitignore Files: A Guide for Beginners\" \/>\n<meta property=\"og:description\" content=\"A .gitignore file allows you to exclude files from your git commits. On Career Karma, learn how to write and use .gitignore files.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/gitignore\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-02T03:00:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:03:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/troy-chen-G_EL_XLKBcc-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"666\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/gitignore\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/gitignore\\\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\".gitignore Files: A Guide for Beginners\",\"datePublished\":\"2020-11-02T03:00:16+00:00\",\"dateModified\":\"2023-12-01T12:03:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/gitignore\\\/\"},\"wordCount\":1313,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/gitignore\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/troy-chen-G_EL_XLKBcc-unsplash.jpg\",\"articleSection\":[\"Git\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/gitignore\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/gitignore\\\/\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/gitignore\\\/\",\"name\":\".gitignore Files: A Guide for Beginners | Career Karma\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/gitignore\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/gitignore\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/troy-chen-G_EL_XLKBcc-unsplash.jpg\",\"datePublished\":\"2020-11-02T03:00:16+00:00\",\"dateModified\":\"2023-12-01T12:03:31+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"A .gitignore file allows you to exclude files from your git commits. On Career Karma, learn how to write and use .gitignore files.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/gitignore\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/gitignore\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/gitignore\\\/#primaryimage\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/troy-chen-G_EL_XLKBcc-unsplash.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/troy-chen-G_EL_XLKBcc-unsplash.jpg\",\"width\":1000,\"height\":666},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/gitignore\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Git\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/git\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\".gitignore Files: A Guide for Beginners\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/author\\\/jamesgallagher\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":".gitignore Files: A Guide for Beginners | Career Karma","description":"A .gitignore file allows you to exclude files from your git commits. On Career Karma, learn how to write and use .gitignore files.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/careerkarma.com\/blog\/gitignore\/","og_locale":"en_US","og_type":"article","og_title":".gitignore Files: A Guide for Beginners","og_description":"A .gitignore file allows you to exclude files from your git commits. On Career Karma, learn how to write and use .gitignore files.","og_url":"https:\/\/careerkarma.com\/blog\/gitignore\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-11-02T03:00:16+00:00","article_modified_time":"2023-12-01T12:03:31+00:00","og_image":[{"width":1000,"height":666,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/troy-chen-G_EL_XLKBcc-unsplash.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/gitignore\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/gitignore\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":".gitignore Files: A Guide for Beginners","datePublished":"2020-11-02T03:00:16+00:00","dateModified":"2023-12-01T12:03:31+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/gitignore\/"},"wordCount":1313,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/gitignore\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/troy-chen-G_EL_XLKBcc-unsplash.jpg","articleSection":["Git"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/gitignore\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/gitignore\/","url":"https:\/\/careerkarma.com\/blog\/gitignore\/","name":".gitignore Files: A Guide for Beginners | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/gitignore\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/gitignore\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/troy-chen-G_EL_XLKBcc-unsplash.jpg","datePublished":"2020-11-02T03:00:16+00:00","dateModified":"2023-12-01T12:03:31+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"A .gitignore file allows you to exclude files from your git commits. On Career Karma, learn how to write and use .gitignore files.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/gitignore\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/gitignore\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/gitignore\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/troy-chen-G_EL_XLKBcc-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/troy-chen-G_EL_XLKBcc-unsplash.jpg","width":1000,"height":666},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/gitignore\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Git","item":"https:\/\/careerkarma.com\/blog\/git\/"},{"@type":"ListItem","position":3,"name":".gitignore Files: A Guide for Beginners"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/19682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=19682"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/19682\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/19773"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=19682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=19682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=19682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}