Line 140: |
Line 140: |
|   OR <br> | |   OR <br> |
| <b>git add -u</b> <br> | | <b>git add -u</b> <br> |
− | <  <i> - Adds modified and deleted files only. Excludes new files. It will include files in the current directory and in higher directories that belong to the same git repository</i><br><br> | + |   <i> - Adds modified and deleted files only. Excludes new files. It will include files in the current directory and in higher directories that belong to the same git repository</i><br><br> |
| For a more detailed description of <i>git add</i> go to: https://github.com/git-guides/git-add</li><br> | | For a more detailed description of <i>git add</i> go to: https://github.com/git-guides/git-add</li><br> |
| | | |
Line 168: |
Line 168: |
| | | |
| == <i>Ignoring Files (.gitignore)</i> == | | == <i>Ignoring Files (.gitignore)</i> == |
− | There are various reasons to not want to track/push files. Here are some and how to handle them. | + | There are various reasons to not want to track/push files. The following situation helps when you're having trouble pushing files due to them being too big (>50 MB, GitHub max) . |
| <ol> | | <ol> |
− | <!-- Step 1 -->
| + | <li><u>Find those problem files</u>: <br> |
− | ===Case 1 ===
| |
− | Case #1 - Trouble pushing files due to being too big (>50 MB, GitHub max) <br>
| |
− | <li><u>Find those files</u>: <br> | |
|   - Ensure you're in the directory of interest (use <b>cd </b> command as needed) <br> | |   - Ensure you're in the directory of interest (use <b>cd </b> command as needed) <br> |
|   - Type <b>find . -type f -size +50M </b><br> | |   - Type <b>find . -type f -size +50M </b><br> |
Line 181: |
Line 178: |
|   - To create one use the command <b>touch .gitnore </b><br> | |   - To create one use the command <b>touch .gitnore </b><br> |
|     Make sure you are in the root folder of your repository on your local computer when you use this command <br> | |     Make sure you are in the root folder of your repository on your local computer when you use this command <br> |
− |     Hint - The root folder is named the same as your repository on GitHub </li><br> | + |     <u>Hint</u> - The root folder is named the same as your repository on GitHub </li><br> |
| | | |
| <li><u>Use your favorite text editor to open the file (i.e. Vim, Notepad++, etc.)</u>: <br> | | <li><u>Use your favorite text editor to open the file (i.e. Vim, Notepad++, etc.)</u>: <br> |
|   - Enter the oversized files from above into the girignore file<br> | |   - Enter the oversized files from above into the girignore file<br> |
− |     Make sure to remove the . if you decide to copy/paste <br> | + |     Make sure to remove the <b>.</b> if you decide to copy/paste <br> |
| <i><u>Example</u>:</i></li> | | <i><u>Example</u>:</i></li> |
| | | |
Line 215: |
Line 212: |
|   - Do this for all files that require it before proceeding </li><br> | |   - Do this for all files that require it before proceeding </li><br> |
| | | |
− | | + | <li><u>Add, commit, and push the .gitignore file</u>: <br> |
− | # If you want to ignore a file that is already checked in,
| + |   - Add the gitignore file using <b>git add .gitignore </b> <br> |
− | # you must untrack the file before you add a rule to ignore it.
| + |   - Commit the file using <b>git commit -m "Files to ignore" </b> <br> |
− | # From your terminal, untrack the file:
| + |   - Push the commit using <b>git push origin main </b> <br> |
− | #
| + |     Now subsequent pushes will know to ignore those files or types of files </li> <br> |
− | | |
− | | |
− | | |
− | | |
− | | |
| | | |
| == <u><i>Extras</i></u> == | | == <u><i>Extras</i></u> == |