Skip to content

Commit 0ffe364

Browse files
4th Update README.md
1 parent f8df8d5 commit 0ffe364

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ commit is a way to save your changes to your repository. It is a way to record y
130130
```cmd
131131
git status
132132
```
133+
## Complete git flow A complete git flow
134+
135+
A complete git flow, along with pushing the code to github looks like this:
136+
![View on Eraser](https://app.eraser.io/workspace/SMlHs99FVb8wFX7uXTLP/preview?elements=saaYh4YXnoXzKAPF2YJXgA&type=embed)
133137
## Logs
134138
The git log command is a powerful tool in Git that allows you to view the history of your repository. When used with the --oneline option, it presents this history in a simplified, condensed format. Here's a quick guide to help you understand and use these commands effectively.
135139

@@ -195,3 +199,26 @@ Example :
195199
secret.txt
196200
197201
```
202+
# .gitkeep
203+
When working with Git, you might encounter a file named .gitkeep. It’s not an official Git feature but a widely used convention. Here’s a quick guide to understanding and using `.gitkeep` effectively.
204+
205+
#### What is .gitkeep?
206+
- **Purpose** : Keeps empty directories in Git repositories.
207+
- **Function** : Ensures that directories without files are tracked by Git.
208+
#### Why Use .gitkeep?
209+
Git Basics: Git only tracks files, not empty directories. Without a file, empty directories won’t be committed.
210+
Project Structure: Sometimes, you need to maintain a specific directory structure for your project. `.gitkeep` helps achieve this by making sure the directories stay in the repo.
211+
212+
#### How to Use .gitkeep
213+
1. Create an Empty Directory:
214+
215+
- Navigate to your project directory.
216+
- Create the desired empty directory if it doesn’t exist.
217+
218+
2. Add .gitkeep:
219+
- Inside the empty directory, create a file named .gitkeep.
220+
![logo](https://app.eraser.io/workspace/SMlHs99FVb8wFX7uXTLP/preview?elements=s0eXJRwy1oRHmgIAnk_ZWg&type=embed)
221+
#### Best Practices
222+
- **Consistency** : Use .gitkeep consistently across your projects to avoid confusion.
223+
- **Documentation** : Add a note in your project’s documentation explaining why and where you use .gitkeep.
224+
- **Cleanliness** : Periodically check if the directories still need to be empty or if files have been added, making .gitkeep unnecessary.

0 commit comments

Comments
 (0)