error on branch master nothing to commit, working directory clean, when try to commit my changes.

0 votes

I installed git in my Linux system. But whenever I tried to commit, It shows me  "On branch master nothing to commit, working directory clean".

What I am doing wrong?

Apr 10 in Git & GitHub by akhtar
• 10,330 points

1 answer to this question.

0 votes


 If you already have a .git/ folder in your repository git init doesn't initialize. So, follow the below given steps.

  • remove .git/ folder

$ rm -rf .git/
  • Initialize git folder again.

$ git init
  • Add remote url.

git remote add origin url
  • Now commit your changes.

git commit -m “Commit message”
  • Finally push in github.

git push -f origin master

Hope this will help you.

answered Apr 10 by MD
• 22,520 points

Related Questions In Git & GitHub

0 votes
0 answers
0 votes
1 answer

How to solve the ‘Git commit -a error’?

This happens when no editor is set. ...READ MORE

answered Jul 5, 2018 in Git & GitHub by Tyrion anex
• 8,370 points
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,400 points
0 votes
1 answer
0 votes
1 answer
+1 vote
2 answers