所有东西都是最新的(一切都不是) [英] Everythings up to date (everything-isn't)

查看:93
本文介绍了所有东西都是最新的(一切都不是)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我一直试图让我的临时分支整日工作,但我错过了一些东西。



这是一系列事件:

p>

  git branch 
develop
* master
staging

进行一些更改

  git checkout staging 
M app / views / comments / index.html.erb
M app / views / devise / registrations / new.html.erb
M app / views / devise / sessions / new.html。 erb
M app / views / layouts / application.html.erb
M app / views / songs / contact.html.erb
M app / views / songs / faq.html.erb
M app / views / songs / index.html.erb
M app / views / songs / new.html.erb
M app / views / songs / new_songs.html.erb
切换到分支'分段'

git gui(git commit然后git push staging)
git checkout master
git push staging master(部署)

一切都是最新的

一切都不是最新的,我只做了10次更改我希望在我的临时服务器上看到。



如何获得此工作?

解决方案

您的工作流中缺少一个关键步骤:在提交之前添加更改。



在使用 git之前提交,运行 git add -A 将工作目录中的所有文件添加到你的git仓库中。或者,您可以使用 git add 添加特定文件,或使用 git commit -a 将所有修改添加到您的git仓库。但是请注意, git commit -a 不会添加新文件,它只会添加您对已有文件所做的更改。



如果您想查看自己的位置,请输入 git status 。红色文件已更改,未冻结(暂存更改等同于添加),而绿色文件已添加。如果 git status 表示工作目录干净,那么自上次提交以来您没有做任何更改。


So, I've been trying to get my staging branch workin' all day but I'm missing something.

This is the chain of events:

git branch 
develop
*master
staging

make some changes

git checkout staging
M   app/views/comments/index.html.erb
M   app/views/devise/registrations/new.html.erb
M   app/views/devise/sessions/new.html.erb
M   app/views/layouts/application.html.erb
M   app/views/songs/contact.html.erb
M   app/views/songs/faq.html.erb
M   app/views/songs/index.html.erb
M   app/views/songs/new.html.erb
M   app/views/songs/new_songs.html.erb
Switched to branch 'staging'

git gui (git commit and then git push staging)
git checkout master
git push staging master (deployment)

Everything up-to-date

Everything isn't up to date, I just made 10 changes that I'd like to see on my staging server.

How can I get this workin' ?

解决方案

There is a key step missing from your workflow: Adding changes before committing them.

Before using git commit, run git add -A to add all files in the working directory to your git repo. Alternatively, you can use git add <path-to-file> to add a specific file, or use git commit -a to add all modifications to your git repo. Note, however that git commit -a won't add new files, it will just add changes you've made to preexisting files.

If you ever want to see where you're at, type git status. Red files are changed, unstaged("staging" a change is equivalent to "adding" it), while green files have been added. If git status says "working directory clean", then you haven't made any changes since your last commit.

这篇关于所有东西都是最新的(一切都不是)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆