How do I push to a new branch using github desktop? - github-desktop

Using just the GUI how would I execute this command in github desktop?
git push <remote> <source branch>:<dest branch>
I wish to push to origin but a different branch name using just the GUI.

Related

Move code from one repo to another

I have a github repository called A. It's connected to heroku-A and the website is up and running. I did changes locally to the code, but I don't want those changes to show on repository A or heroku-A. I want to push the code to a totally new repo. How can I do this?
Here would be the procedure:
Create a new git branch (so that code is separate from your other repo)
git checkout -b <new_branch>
Add a remote pointing to your new repository
git remote add <new_repository_url> <new_repository_name>
Push the new branch to the new repository:
git push <new_repository_name> <new_branch>

Can't push from XCode to Github master branch

I created a new repository on github, modified the default readme file and then created a development branch to work on my project.
I have successfully commited and merged on development branch after it, sending all local modifications to github.
But when I try to push my local modifications to the master branch, XCode returns the following message:
The local repository is out of date
Make sure all changes have been pulled from the remote repository and try again.
And if I try to pull the changes..
How can I correctly push my project to the master branch?
You must do a git pull before you push to the server.
There are updates on the serer which you don't have on your repository.
git pull origin <branch
git push origin <branch>
When you try to push git verify that the latest commit from the server is in your local branch. if it does not - if you don't have it locally yo will be asked to pull the changes form the server before you can push your updates.

Bamboo infinite loop

Having some major issues with Bamboo.
I run a rails project, that runs on Engine Yard.
My build strategy is as follows
Checkout from Source Code
bundle install
rspec (run tests)
Tag my build
(code to create tag causes new commit, tag used in deploy)
git remote remove origin
git remote add origin <my repo>
git tag Bamboo-${bamboo.buildNumber}
git push origin Bamboo-${bamboo.buildNumber}
In my deploy the way engine yard works is you deploy based on branches or tags ( there is no build artifacts)
So in my Deploy it's a single script that uses a gem https://github.com/engineyard/engineyard
and runs
ey deploy --environment <staging> --tag=Bamboo- ${bamboo.buildNumber} --app <my app>
Engine yard does all the rails 'stuff' to prep the build and deploy it. Really just need Bamboo to run test and if it works tag build.
PROBLEM
I am using bitbucket source control and have configured a hook to trigger a bamboo build on any commit to master.
The issue step 4) is pushing a tag which causes bitbucket to execute another build
Resulting in infinitely building bamboo.
Looking into how to solve this. Figured I could use Bamboo 'Exclude Changesets' and filter out a particular commit message
https://confluence.atlassian.com/display/BAMBOO/Bitbucket?focusedCommentId=610435557&#comment-610435557
so my 4) would now look like
git remote remove origin
git remote add origin <my repo>
#create tag
git tag -a Bamboo-${bamboo.buildNumber} - m 'bamboo build'
#push tag
git push origin Bamboo-${bamboo.buildNumber}
However as per the comments on that confluence page. Exclude Changsets isn't a visible option anymore?
I don't understand how I can stop this infinite building loop.
We use Bamboo and a tag doesn't kick off the build for us.
Our tag process is:
git tag -a v1.4.2 -m 'Production Release: [date]
git push origin --tags
Try using the --tags option when pushing.

jenkins doesn't generate the build automatically using local git repository

In my system i am using local git repository and jenkins server,I clone the bitbucket repository into my local git repository and perform all the operations it does well.
I would like to generate the bulids automatically whenever there is push is going from local git to bitbucket for that i give the git repository url in the source code management and mark the build trigger `when a change is pushed to bitbucket
Later i apply and press save.
Now I did some modifications in local git and pushed it also,it is successfully pushed and data is updated in bitbucket also but in jenkins there is no build
can any one please help to me.
If you do not want to poll, you must configure BitBucket to notify your Jenkins when something happens. These are called "hooks". You can read about them at https://confluence.atlassian.com/display/BITBUCKET/Manage+Bitbucket+hooks and there is a whole section on how to configure a hook for Jenkins.

Backing up work on a branch using heroku, rails and git

Rails/Heroku/Git newbie - here is my question. I have an app deployed with Heroku and am using the git repository hosted there as the only remote copy of my local work. I start making changes locally on a new branch and want to make this branch available on Heroku so that I can continue work on it from another computer. Heroku ignores branches other than master and I don't want to merge my changes yet (or push them as master). Is there a way to store/access my new branch via my Heroku git repository, or is it better to have another remote git repository for my work in progress.
Thanks!
You can push a local branch to the remote git server with:
git push origin branch_name
That way, you can pull it down again elsewhere with:
git checkout -b branch_name origin/branch_name
http://gitready.com/beginner/2009/02/02/push-and-delete-branches.html
http://gitready.com/intermediate/2009/01/09/checkout-remote-tracked-branch.html
I would go with a separate git repository as suggested - github.com or similar. Store your code there and deploy to Heroku's master repo - Heroku is a hosting platform afterall not a home for your repos.
ALTERNATIVELY Make use of dropbox and create your local workspace in a dropbox folder that is synced across multiple computers - I employ this method as well as git - plus you get the advantage that Dropbox is versioned so if you delete/change a file that you haven't committed yet you can get it back.

Resources