cannot push to github: everything up-to-date
On github, I forked an old version of another project. I made some changes and am trying to push them onto my fork on github. I commited the changes locally, then tried git push, but this simply tells me «Everything up-to-date». When I browse the project on github, however, nothing has changed: it still shows the files (from the latest version) on my fork, unmodified. How can I push the changes to my github account?
(I realize this isn’t much information. what else can I say? I have a feeling that it may be because I’m modifying the files directly in (home)/git/(project). )
6 Answers 6
That means you are in a DETACHED HEAD mode.
You can add and commit, but from the upstream repo point of view (ie from the GitHub repo), no new commits are ready to be pushed.
You have various ways to include your local (detached HEAD ) commit back into a branch, which you will be able to push then.
See:
The OP mentions this article in order to fix the situation:
«git: what to do if you commit to no branch»
all we need to do is checkout the branch we should have been on and merge in that commit SHA:
Note that instead of merging the SHA1 that you would have somehow copied, you can memorize it with a script, using head=$(git rev-parse HEAD) :
See «git: reliably switching to a detached HEAD and then restore HEAD later, all from a script».
Then you can merge that detached HEAD back to the right branch.
Git push говорит все актуальное, хотя у меня есть локальные изменения
У меня есть удаленный сервер gitosis и локальный репозиторий git, и каждый раз, когда я вношу большие изменения в свой код, я также нажимаю изменения на этом сервере.
Но сегодня я нахожу, что даже если у меня есть локальные изменения и фиксация в локальном репозитории, при запуске git push origin master он говорит «Все обновлено», но когда я использую git клон для проверки файлов на удаленном сервере, он не содержит последних изменений. И у меня есть только одна ветка с именем master и один удаленный сервер с именем origin.
PS: Это то, что отображает git при запуске ls-remote, я не уверен, помогает ли он
ОТВЕТЫ
Ответ 1
Вы не могли бы работать с отсоединенным голосом случайно?
указывающий, что ваша последняя фиксация не является ветвью ветки.
Иногда полезно иметь возможность проверять фиксацию, которая не находится на кончике одной из ветвей.
Наиболее очевидным примером является проверка фиксации в помеченной официальной точке выпуска, например:
Ответ 2
Ответ 3
Возможно, вы нажимаете новую локальную ветвь?
Новая локальная ветвь должна быть явно нажата:
Только одна из этих вещей о git. Вы клонируете репо, создаете ветку, совершаете некоторые изменения, нажимаете. «Все в актуальном состоянии». Я понимаю, почему это происходит, но этот рабочий процесс крайне недружелюбен для новичков.
Ответ 4
Моя проблема заключалась в том, что мой локальный филиал имел другое имя, чем удаленная ветка. Я смог нажать, выполнив следующее:
$ git push origin local-branch-name:remote-branch-name
Ответ 5
Еще одна ситуация, которая важна для понимания: Тип состояния по умолчанию для git заключается в том, что вы работаете в ветке «master». И для многих ситуаций вы просто будете входить в это как свою основную рабочую ветвь (хотя некоторые люди получают фантазию и делают другие вещи).
Итак, я обычно нажимаю ведущую ветвь на общий репо. что, вероятно, является хорошей чистой вещью, в моем случае.
Но я забыл, что изменения, над которыми я работал, еще не вошли в мастер-ветку.
Поэтому вместо этого я объединяю свою ветку в мастер, а затем нажимаю, и все снова радует.
Ответ 6
Объяснение
У меня была такая же ошибка & провел часы, пытаясь понять это. Наконец я нашел это. Чего я не знал, так это того, что нажатие git push origin branch-x попытается найти локальную ветвь-x, а затем нажать удаленную ветвь-x.
В моем случае у меня было два удаленных URL. Я сделал извлечение из branch-x в branch-y, когда пытался переместить с y локально на x remote. У меня было сообщение, что все обновлено, что является нормальным, потому что я нажимал на х второго пульта.
Короче говоря, чтобы не попасть в такую ловушку, вам нужно указать исходную ссылку и целевую ссылку:
Обновление:
Если вам нужно запускать эту команду каждый раз, когда вы нажимаете на свою ветку, вам, возможно, потребуется установить восходящий поток между вашим локальным & удаленная ветка со следующим:
Ответ 7
Ответ 8
Ответ 9
В вашем статусе git у вас, вероятно, есть другая ситуация. Моя работа.
Но так или иначе, вот что со мной произошло. Я столкнулся со следующей ошибкой:
Более информативное сообщение здесь заключается в том, что удаленный пользователь повесил трубку. Оказалось, это связано с превышением размера почтового буфера http. Решение состоит в том, чтобы увеличить его с помощью
git config http.postBuffer 524288000
Ответ 10
У меня была эта проблема сегодня, и она не имела никакого отношения к каким-либо другим ответам. Вот что я сделал и как я его исправил:
Я надеюсь, что это поможет любому, у кого была такая же проблема!
Ответ 11
Решение состоит в том, чтобы вручную удалить соответствующую строку из упакованных ссылок. Не нашел более чистого решения.
Ответ 12
Я столкнулся с этим сам, когда я объединил ветку на Гитубе и продолжал развиваться в ней локально. Мое исправление было немного иным, чем другие, которые были предложены.
Сначала я разветкил новую локальную ветку с моей старой локальной ветки (которую я не мог нажать). Затем я переместил новую локальную ветвь на исходный сервер (Github). То есть.
Это привело к появлению изменений в Github, хотя и в newlocalbranch, а не oldlocalbranch.
Ответ 13
В моем случае у меня было 2 удаленных РЕПО.
Ответ 14
Ответ 15
Убедитесь, что вы не удалили свой удаленный URL.
Я просто хотел упомянуть, что я столкнулся с этим после включения Git в качестве CVS в локальной конфигурации сборки Jenkins. Похоже, что Дженкинс проверил самую последнюю фиксацию ветки, которую я ей дал, а также reset мой пульт, чтобы соответствовать путям, которые я дал ему в репо. Пришлось снова проверить мою ветку свойств и исправить исходный удаленный URL с ‘git remote set-url’. Не указывайте инструмент сборки в рабочий каталог, иначе у вас будет плохое время. Мой пульт был установлен в путь к файлу моего рабочего каталога, поэтому он, естественно, сообщал обо всех актуальных моментах, когда я пытался нажимать изменения с тем же источником и местом назначения.
Ответ 16
Ответ 17
Ответ 18
Я была такая же проблема. В моем случае это было вызвано необходимостью имен для одного и того же пульта. Он создал стандартную «origin», но я давно использовал «github» в качестве пульта, так что это тоже было там. Как только я удалил пульт «origin», ошибка исчезла.
Ответ 19
У меня было такое (коммиты в моем журнале git не были на GitHub, хотя git сказал, что все было в курсе), и я уверен, что проблема была в Github. Я не получил никаких сообщений об ошибках в git, но GitHub имел ошибки состояния, и мои коммиты были там через несколько часов.
Сообщения о состоянии GitHub были:
Ответ 20
ПРИМЕЧАНИЕ: он не выдает никаких ошибок! Но вы не сможете выдвигать свои коммиты и всегда обновлять Everything up to date
Ответ 21
здесь мое решение отличается от вышеупомянутого. Я не понял, как эта проблема происходит, но я исправил ее. немного неожиданно.
Git push says “Everything up-to-date” but the files are not appearing in github repository #4320
Comments
ronaldorawat commented Nov 24, 2020
Describe the issue
I initiated git to push things in repo. I entered the commands in below order:-
[master (root-commit) 51ccb20] COmmit for the Submit form
2 files changed, 414 insertions(+)
create mode 100644 form.css
create mode 100644 form.html
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 12 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 2.71 KiB | 694.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
remote:
remote: Create a pull request for ‘master’ on GitHub by visiting:
remote: https://github.com/ronaldorawat/FreeCodeCamp-Form/pull/new/master
remote:
To https://github.com/ronaldorawat/FreeCodeCamp-Form.git
Everything up-to-date
Branch ‘master’ set up to track remote branch ‘master’ from ‘origin’.
System environment
Output of git lfs env
The output of running git lfs env as a code block.
git-lfs/2.12.0 (GitHub; windows amd64; go 1.14.7; git dad7b9e)
git version 2.29.2.windows.1
Additional context
This has happened second time. When files were not added by running but bash, I had to select the files using add files option in Github REPO. The only file was READ Me which I wanted while creating the repo.
The text was updated successfully, but these errors were encountered:
git push heroku master says «Everything up-to-date», but the app is not current
I have an app on Heroku that is running old code. I’ve made a small change and committed the change. I then ran
But if I go and look at the app, it’s all old code. I did revert the site back to another version in Heroku about 15 days ago, but pushed updates to it since then and they worked.
Why is heroku not getting the most current files from my github repository? Is there a way to just reset the app and push the files from github again? I have production data in the database so I do NOT want to touch it.
12 Answers 12
Kindly confirm your current branch is master.
If the pointer is not pointing the master, then check out to master branch
Commit your changes and try to push to heroku
You have two options
1.Merge your changes with master and push them.
Commit your changes in your actual branch, then merge them with master
2.Push your changes from your actual branch
I had a similar issue and by no means my changes were visible on heroku. To reconfirm myself I even took a clone from heroku and it was obviously up to date.
I could resolve my issue only by following this approach:
Step 1: Make a new branch from master
Step 2: Just add a comment in any file to make a new commit and then:
Step 3: Push the new branch to heroku.
You could now see your changes successfully on heroku.
Even though this is an old issue, I wanted to update with what worked for me (a newbie) should anyone else run into this:
After following the instructions here (from Hudson), what finally did the trick for me was doing a «git pull» after checking out the «master» branch. Perhaps «git push heroku master» pushes out only the local branch of master?
Of course, this assumes all required changes have been correctly merged into your master. I hadn’t pulled from master on my local since the project set up because all merges (from development to master) were handled on GitHub and I had been working on new branches that were later merged with development.
So, to restate steps above from Hudson:
git checkout master
(here, I updated README to have a change to commit, like «Heroku deploy [date, time]»
Git pull says ‘everything is up to date’
I am working on a project with a few friends, and we are uploading everything to git. At first everything worked good, but at my local repository i deleted some files, online these files are still existing, so I tried
only, because i deleted that folders, they aren’t coming back. Git says ‘everything is up to date’, but it isn’t. Another stackoverflow-questioner had the same problem, and in a comment someone said he should use
aand yes, there are the files i was looking for, but (I guess) that’s just checking out, and they are not in my file system. How can i solve this problem?
In general: I guess there must be a command that updates everything?
4 Answers 4
From your comments it looks like you might have committed the deleted changes,
1 should be used with care as it will remove your local commit by one. But if you want the deleted changes and u dont care about the modifications then this is a good idea.
If you had committed the deletion of those files (therefore telling Git you wanted to keep that change), then this question would have an entirely different answer.
Changes to your local file system that have not been committed are viewed by git as «Not having happened yet». What git is doing it managing your history. When you commit changes (adding files, removing files, changing files), you are recording that state in the history of the working copy.
What git pull and git push do are «get a copy of all the changes that have happened on the remote» and «tell the remote the changes that have happened». When you do a git pull, you are taking any commits that you do not know about locally and applying them to your repository. If no new commits are ever pushed to that remote, not matter how many times you pull, after the first time you will always receive the message that «Everything is up to date».








