Git add error - error: 'main/' does not have a commit checked out

Pubblicato il: 13 gennaio 2023
sul canale di: Littles Law
17,767
271

"If you found this solution helpful, please consider showing your support by giving a Super Thanks. Your appreciation helps me continue creating high-quality content."

When I tried to push a repo to github . I followed the steps but faced the following error

1. git init
2. git add .

when I run command: git add . I get this error:
git add .
error: ‘main/’ does not have a commit checked out
fatal: adding files failed.

How to resolve this.. Lets see this in the video.


Here are the timestamps from the video with timings:

1. 00:00:11 - Introduction to the Issue](   • Git add error - error: 'main/' does not ha...   Explanation of the error "does not have a commit checked out."
2. 00:00:44 - Demonstration of the Error](   • Git add error - error: 'main/' does not ha...   Attempting to add files to Git and encountering the error.
3. 00:01:16 - Identifying the Cause](   • Git add error - error: 'main/' does not ha...   Discovering a `.git` folder inside the target directory.
4. 00:01:47 - Solution: Deleting the `.git` Folder](   • Git add error - error: 'main/' does not ha...   Steps to remove the hidden `.git` folder.
5. 00:02:18 - Successful Resolution](   • Git add error - error: 'main/' does not ha...   Running `git add` again to confirm the fix.
6. 00:03:01 - Recap and Conclusion](   • Git add error - error: 'main/' does not ha...   Summary of the solution and closing remarks.

Click the links to jump directly to these moments in the video.

Thank you for watching this video. Please like, subscribe and share, and if you have any doubts/questions on Performance testing/engineering/Devops related , leave me a comment in the comments section to let us know . and good luck!


In questa pagina del sito puoi guardare il video online Git add error - error: 'main/' does not have a commit checked out della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Littles Law 13 gennaio 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 17,767 volte e gli è piaciuto 271 spettatori. Buona visione!