Nothing to commit, working tree clean


I’m just starting using Git and GitHub so please be patient with me as I really want to learn :slight_smile:

So the problem is: my local and remote depository has been already linked. My first commit is also visble here, on GitHub but I can’t push any new commits. This is what I get:

$ git commit -m “version 1”
On branch master
Your branch is up to date with ‘origin/master’.
nothing to commit, working tree clean

I tried to look for the answer online but it doesn’t seem to help me.


@joanna89polska if you need to push your commits up to GitHub you can use the following command:

git push origin master

In this command origin refers to the URL of the repository on GitHub, and master is the current branch of your repository that you are wanting to push to.

I’d also recommend checking out GitHub Desktop – it’s a GUI application that we specifically built to help make it easier to use Git and GitHub. You can download it at Let me know if you have any other questions!


hello steveward 

im facing the same issue before  ‘git push origin master’

 i’m getting 

‘On branch master
nothing to commit, working tree clean’

on ‘git commit -m “add”’

Please let me know where i’m lagging!



Make new repo and push the existing code again to the new repo

git init doesn’t initialize if you already have a .git/ folder in your repository. So, for your case, do -

(1) rm -rf .git/

(2) git init

(3) git remote add origin https://repository.remote.url

(4) git commit -m “Commit message”

(5) git push -f origin master

Note that all git configs like remote repositories for this repository are cleared in step 1. So, you have to setup all remote repository URLs again.

Also, take care of the -f in step 5 : The remote already has some code base with n commits, and you’re trying to make all those changes into a single commit. So, force-pushing the changes to remote is necessary.


This worked for me. Thanks a lot

1 Like

It worked for me ,Thankyou

Thanks, it helps. Your tips really solved my problem

Thanks a lot! That worked

woondeful it works!!!

Well done :kissing: :kissing_closed_eyes:

Thanks @akgarg007. It saved me couple of hours Sir next 007.

C:\Users\priyankar\eclipse-workspace\ZH_blueEHR>git commit -m “test1”
On branch master
nothing to commit, working tree clean

C:\Users\priyankar\eclipse-workspace\ZH_blueEHR> rm -rf .git/
‘rm’ is not recognized as an internal or external command,
operable program or batch file.

How to rresolve this? Please help!

I didn’t understand this step, how to do it?

git init doesn’t initialize if you already have a .git/ folder in your repository. So, for your case, do -

(1) rm -rf .git/

rm -rf .git
This command removes the .git folder in the Local Repository
Try this out. It would certainly work. Drop the forward slash it will work.

Coming to question I’m back to square one.

This is a very useful pattern. Thanks so much!

this is not working for me. its saying rf is no a recognized command.

nice :star_struck:
is work for me thanks you

Thanks veeeery much!!!

this has worked for me, thank you