Update version, commit and push back to github

geobmx540's Avatar

geobmx540

08 Jun, 2017 11:54 PM

I'm attempting to update a version number in packages.json and then have that committed and pushed back to GitHub (back to the branch it was from). I'm getting not on a branch errors:

    $configFile = "$env:APPVEYOR_BUILD_FOLDER\package.json"
    
    $j = Get-Content $configFile | ConvertFrom-Json
    
    $j.version = $env:APPVEYOR_BUILD_VERSION
    
    $j | ConvertTo-Json | set-content $configFile
    
    git add 'package.json'
    
    git commit -m 'v$env:APPVEYOR_BUILD_VERSION'
    
    git push

Results in : git : fatal: You are not currently on a branch.

  1. 1 Posted by Ilya Finkelshte... on 09 Jun, 2017 09:04 PM

    Ilya Finkelshteyn's Avatar

    By default AppVeyor check out specific commit and it is detached. You may need to add git checkout master. Also please read this part of documentation to learn how to deal with credentials.

  2. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:17 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac