English 中文(简体)
heroku using git branch is confusing!
原标题:

Ok, so I have a big github project that i m not supposed to merge my little Stacia branch into. However, it seems like Heroku only takes pushing MASTER seriously. It looks like I pushed my branch, but for example if I only have my branch, it even acts like there s no code on the server. I can t even get my gems installed since the .gems file is on my branch.

Basically I don t even want Heroku to know there s a master. I just want to use my test Stacia branch. But it keeps ignoring my local branch. Is there a way to do this? And again, I don t want to overwrite anything on the main Github repository (eeek!) but it would be ok probably if I had both master and my branch on heroku and merged them there.

I am a total git novice (on windows no less) so please bear with me.

最佳回答

The first step is make sure you have rebase your local branch on top of its master (Let s suppose it is in its repo mainGitHubRepo )

git fetch mainGitHubRepo master
git checkout -b mainGitHubMaster mainGitHubRepo/master

Then go back to your branch and replay it on top of mainGitHubMaster :

git checkout Stacia
git rebase mainGitHubMaster

As georgebrock mentions in the comment, you don t have to create the intermediate local branch mainGitHubMaster: you can directly rebase on top of the fetch branch.

git checkout Stacia
git rebase maingithubrepo/master

After that, you can push your branch to your GitHub fork, and then make a pull request.

To push a local branch to an established remote, you simply need to use:
git push REMOTENAME BRANCHNAME.
If you don’t want to use the same name on the remote branch you can use:
git push REMOTENAME LOCALBRANCHNAME:REMOTEBRANCHNAME.

(which is what David Dollar mentions in his answer: git push heroku yourbranch:master)

Note: if you have your own fork on GitHub, you could work directly on master for this fork, meaning your pull request would come from a master branch, enhancing your chances to be considered.
But the aforementioned process remains valid: your pull request must result in trivial merges for the one who will integrate your changes, hence the rebase step to be made locally.

问题回答

If you want to push a different branch to Heroku you can do something like

git push heroku yourbranch:master




相关问题
Tracking Versions, Builds, Revisions, with TortiseSVN

I am the sole developer on a project and have been using tortoiseSVN for quite a while. Now Id like to start getting version information working correctly in the project I.E. show Major Version, Minor ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

How to handle different csproj [closed]

I am working in a team of five. We are working on a C# application with five csprojects. The problem is that for each csproject, each of my colleagues has their own ideas on how to reference a DLL; ...

Changing username in SVN+SSH URI on the fly in working copy

I am using SVN+SSH to check out a working copy of repository from an SVN server on which all developers are members of a developer group and have full read/write permissions on the repository ...

How to search for file in subversion server?

Is there a way to search for a file in a subversion repository? Something similar to Unix find command, with which I can find the location of a file in a repository. I know there is svn list, but ...

热门标签