Can we push to a refs/for/branchname in Stash

Hello ,

Can we push commits / branch to refs/for/branchname in Stash server like gerrit . This can be used to stage changes for build and smoke test .

Regards,

Mohan

3 answers

0 vote
Seb Ruiz Atlassian Team Apr 09, 2013

Yes, you can commit to any ref you like.

Hi Mohan,

As Seb has indicated, you can obviuosly push changes to any ref. But we do not currently support the staging areas in the same way that Gerrit does. The Stash way is push your changes to a new branch and then create a pull request (which then may have automatic Bamboo builds). What I'd like to see at some stage is a plugin that creates those pull requests for you automatically based on the branch name. For now you could use Seb's awesome command line tool for Stash.

Charles

Hi Mohan,

You might be interested in the following:

https://jira.atlassian.com/browse/STASH-2586

Charles

Hi Charles,

As you indicated - " The Stash way is push your changes to a new branch and then create a pull request " . The only thing is see lacking here is user private branch support .Gerrit provides functionality for the creation of an access rule for "refs/heads/dev/${username}/*" branch. Essentially in our work flow we want that the developer should be able to push his branches onto some server, and be sure that nobody else can delete or overwrite them.

Does the command line tool for Stash works in a windows 7 environment ?


0 vote
Adam Ahmed Atlassian Team Apr 09, 2013

Yes it does. You'll need to install Ruby though.

Does it requires installation of any external modules as well?

I installed ruby on my win7 system and installed gem install atlassian-stash. How ever i get the following error when using stash configure . Any clue ?

C:\Ruby200-x64\bin>ruby.exe stash configure

C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/git-1.2.5/lib/git/lib.rb:700:in `command

': git version 2>&1:'git' is not recognized as an internal or external command

, (Git::GitExecuteError)

operable program or batch file.

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/git-1.2.5/lib/git/lib.rb:64

9:in `current_command_version'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/git-1.2.5/lib/git/lib.rb:65

9:in `meets_required_version?'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/git-1.2.5/lib/git.rb:30:in

`<top (required)>'

from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:4

5:in `require'

from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:4

5:in `require'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/atlassian-stash-0.1.6/lib/a

tlassian/stash/pullrequest.rb:4:in `<top (required)>'

from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:4

5:in `require'

from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:4

5:in `require'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/atlassian-stash-0.1.6/lib/s

tash_cli.rb:2:in `block in <top (required)>'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/atlassian-stash-0.1.6/lib/s

tash_cli.rb:2:in `each'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/atlassian-stash-0.1.6/lib/s

tash_cli.rb:2:in `<top (required)>'

from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:4

5:in `require'

from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:4

5:in `require'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/atlassian-stash-0.1.6/bin/s

tash:4:in `<top (required)>'

from stash:23:in `load'

from stash:23:in `<main>'

does this gem works with git 1.8.0 version?

Was able to resolve the above issue . However after creating the Pull request using

stash pull-request mybranch master

i get the follwoing error :

An error occurred while executing an external process: 'C:\Program Files (x86)\Git\bin\git.exe update-ref refs/pull-requests/4/from 0c0ad54e1aa40190982c4eb103906e94b655ebd9' exited with code 128 saying: error: unable to create directory for refs/pull-requests/4/from fatal: Cannot lock the ref 'refs/pull-requests/4/from'.

Could you please help .


Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 06, 2018 in Bitbucket

Do you use Bitbucket Cloud and Jira Cloud? If so, let us know!

Hi Community, I'm Julia and I'm on the Jira Software Cloud marketing team!  We're looking for companies or teams using Bitbucket Cloud and Jira Software Cloud. If your team fits the t...

145 views 6 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you