Nothing to commit, working tree clean #23135
-
Hello! 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” I tried to look for the answer online but it doesn’t seem to help me. |
Beta Was this translation helpful? Give feedback.
Replies: 20 comments 41 replies
-
@joanna89polska if you need to push your commits up to GitHub you can use the following command:
In this command 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 http://desktop.github.com. Let me know if you have any other questions! |
Beta Was this translation helpful? Give feedback.
-
hello steveward im facing the same issue before ‘git push origin master’ i’m getting ‘On branch master on ‘git commit -m “add”’ Please let me know where i’m lagging! Thankyou! |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
This worked for me. Thanks a lot |
Beta Was this translation helpful? Give feedback.
-
It worked for me ,Thankyou |
Beta Was this translation helpful? Give feedback.
-
Thanks, it helps. Your tips really solved my problem |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot! That worked |
Beta Was this translation helpful? Give feedback.
-
Well done 😗 😚 |
Beta Was this translation helpful? Give feedback.
-
Thanks @akgarg007. It saved me couple of hours Sir next 007. |
Beta Was this translation helpful? Give feedback.
-
rm -rf .git Coming to question I’m back to square one. |
Beta Was this translation helpful? Give feedback.
-
This is a very useful pattern. Thanks so much! |
Beta Was this translation helpful? Give feedback.
-
this is not working for me. its saying rf is no a recognized command. |
Beta Was this translation helpful? Give feedback.
-
nice 🤩 |
Beta Was this translation helpful? Give feedback.
-
Thanks veeeery much!!! |
Beta Was this translation helpful? Give feedback.
-
this has worked for me, thank you |
Beta Was this translation helpful? Give feedback.
-
Hello! I am having the same issue with:
I am practicing with https://github.com/ibm-developer-skills-network/vftvk-Simple-Interest-Calculator. On my first attempt. everything went fine until it came time to run the git push command. I ended up deleting my original forked repository and creating a new one, but ever since I did that, I’ve been getting the “nothing to commit, working tree clean” message, after making updates to several files in the project. I am wondering if I maybe forked and deleted the repo too many times? I even tried creating a second github account to start over from scratch but still I am having the same problem. This is what I’ve been doing:
I then go to Github Pages for this repo and select the master branch as the source. I then make changes to index.html, style.css, and script.js files. In the terminal, I then run the following:
It is at this point where I get frustrated. The changes to files that I made go unacknowledged. I also tried |
Beta Was this translation helpful? Give feedback.
-
The message "Nothing to commit, working tree clean" is not an issue; it's an informational message typically displayed by Git when you run the Here's what each part of the message means:
In summary, when you see this message, it means that your project is up to date and there's nothing new to commit at that moment. It's a good indication that your code is in sync with your Git repository. If you've made changes and want to commit them, you'll need to use |
Beta Was this translation helpful? Give feedback.
-
I can't delete the .git file like that. Because this project might be deleted. Any other solutions |
Beta Was this translation helpful? Give feedback.
-
These type of issue will be getting when I am using this command on github. |
Beta Was this translation helpful? Give feedback.
-
这是我解决这个问题的方法: 1.查看安装各hexo插件的情况 2.使用npm ls --depth 0 没有报错先去hexo根目录下的 package.json 查看有没有 hexo-renderer-markdown-it 如果没有需要下载 npm install hexo-renderer-markdown-it 之后输入 hexo g 再 hexo d 上传到网络 |
Beta Was this translation helpful? Give feedback.
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.