开发者

Working with GitHub and Cloud

I can't find a way to work with github and a cloud server that satisfies me.

The cloud server has an 'app' which is my project and inside this app there are different deployments (git branches).

I also have a github repository with my project.

We are 4 guys working on this project. Each of us has its own branch (and deployment in the cloud).

Every time I want to try some new code, I need to commit, push into the cloud and tell the cloud to deploy it. So at the end of the day, I have a lot of commits in my git log. I would like to push to the github too, so everyone can see my branch update, but I don't want everyone to see all my meaningless co开发者_高级运维mmits.

I can solve that problem by doing a rebase to squash them, but next time i push into the cloud i would get in troubles and I would have to force the push. It works, but it feels wrong.

Is squashing the commits, forcing the push into de cloud, and pushing into github the only way to work?

Any ideas?

Thank you a lot. :)


If you want to squash your work in progress commits then I see two options. Either do not push your commits to any remote repository while you work, then squash, then push. Or, use two branches. Work all day on the topic branch. Then create a new branch and git merge --squash into the new branch. It works best if you have your own personal fork of your team's github repo. Only merge the cleaned up, squashed branches into your team's repository and keep the messier stuff in your personal one.


I think squashing the commits it the wrong thing to do. There is no meaningless commit.

Otherwise, your solutions seems to be the one that works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜