Taras Yaremkiv Taras Yaremkiv -4 years ago 297
Git Question

Git push -nothing to commit, working directory clean

I wanted to create another branch ' ServerSR ' but in the end I got ' - nothing to commit, working directory clean'.

Here are the commands that I did in terminal:

At fist I input ..$ git status

On branch master
Your branch is up-to-date with 'origin/master'.

Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

modified: .babelrc
new file: _public/css/bootstrap.min.css
...


Then I entered ..$ git add -A . and

..$ git status

On branch master
Your branch is up-to-date with 'origin/master'.

Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

modified: .babelrc
modified: _public/bundle.js
...


then ..$ git checkout -b ServerSR

M .babelrc
M _public/bundle.js
...
Switched to a new branch 'ServerSR'


after that commited .. $ git commit -m 'SSR'

[ServerSR 529eefa] SSR
33 files changed, 142 insertions(+), 152 deletions(-)
rewrite _public/bundle.js (85%)
create mode 100644 _public/css/bootstrap.min.css
...


And in the end command .@.$ git push returns me:

Everything up-to-date


So it didn't push anything.

Answer Source

Use git push -u origin <branch_name>

In current situation is: git push -u origin ServerSR

More general in shell:

git push -u origin `git symbolic-ref --short -q HEAD`
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download