简体   繁体   中英

Git push to local repo says “everything up to date”, it isn't

I have a theme I use for our merchant store. I use git to maintain a repo (local repo 1) of this theme that i clone into a dev folder (local repo 2) and then work on there, when I'm done I want to update (push?) to the original local repo 1. From there I can render zip files or whatever I need for the merchant store.

So i made repo1 by git init and adding the files and committing it. worked fine. Then I cloned the repo to my dev folder and setup my web services there. Worked great. I edited my theme and made commits appropriately. Now that I am ready to put these changes on the live server I want to push to my origin which should be repo 1. However after making commits when I try to push from repo2 by

git checkout master

and then

git merge classes-migration

and then

git push

it says "everything up to date" I've tried specifying specifically the same branch to push, honestly I've tried all kinds of things reading through the different answers here.


git branch [for repo1]

  classes-migration
  import-classes-migration
  initial-commit
* master

git status [for repo1]

On branch master
nothing to commit, working directory clean

git branch [for repo2]

  classes-migration
* master

git status [for repo2]

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

nothing to commit, working directory clean

git remote show origin [for repo2]

* remote origin
  Fetch URL: /home/user/projects/merchant/repos/theme
  Push  URL: /home/user/projects/merchant/repos/theme
  HEAD branch: master
  Remote branches:
    classes-migration        tracked
    import-classes-migration new (next fetch will store in remotes/origin)
    initial-commit           tracked
    master                   tracked
  Local branches configured for 'git pull':
    classes-migration merges with remote classes-migration
    master            merges with remote master
  Local refs configured for 'git push':
    classes-migration pushes to classes-migration (up to date)
    master            pushes to master            (up to date)

So.. yeah.

The push command is used to put in the server what you already has committed. If you have a git repository configured, clone it in your dev machine, then work in this project. After that you need to commit your changes.

first check the status after the changes:

git status

If you get this message

Changes not staged for commit:

    (use "git add <file>..." to update what will be committed)
    (use "git checkout -- <file>..." to discard changes in working directory)

          modified:   filename.txt

no changes added to commit (use "git add" and/or "git commit -a")

It means you`ve changed the file filename.txt, if you've changed more then one file, every file will be listed here. The next step is commit the file.

git commit filename.txt -m "commit comments"

Just after that, you push to the server:

git push

After this command, when you clone in another machine or update the repository the user will see the modifications.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM