Hi, I’m trying to add my project to github (not a first time), but for some reason I get the message "On branch master
nothing to commit, working tree clean
" when I check the status. I googled couple of solutions, but none of them worked.
Does anyone know what can I do to overcome this problem?
Sorry for a very dumb question, but since you haven’t written it explicitly: Have you added the files you want to push before you committed them?
git add .
git commit -m 'initial commit'
git push
And one time I wrote my question was d***, it got deleted haha
I did everything by the book, even came back to watch the tutorial here, but simply wouldn’t let me add anything.
I tend to have problems when I choose the option ( …or push an existing repository from the command line) from Github due to divergent branch names for the main branch. I remember having had that message before, but I can’t recall the situation – forgetting to add files is one of the possible causes.
I have better experiences with creating the remote repo first and the local repo after that with these commands from github which they provide right after the remote creation of the repo:
echo "# {{reponame}}" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/{{accountname}}/{{reponame}}.git
git push -u origin main
As I understand it’s about the initial push, so you could try deleting your local git folder and redo these steps