rake gen_deploy rejected in Octopress - octopress

I installed Octopress in GitHub Pages.
And I clone the repository.
$ git clone git#github.com:my-name/my-name.github.io.git
$ git checkout source
And
$ rake setup_github_pages
I input my repository name.
And
$ rake gen_deploy
I got error
! [rejected] master -> master (non-fast-forward)
my solution
I resolve this problem, in GitHub delete my-name.github.io.git, and make same name repository and
$ rake gen_deploy
But I don't want to delete repository
What is the best solution?

Without deleting the repository
Please keep in mind this is not considered best practice, but it may work for you.
The solution is to force a push on the master branch.
Edit the Rakefile and look for this line:
system "git push origin #{deploy_branch}"
Alter the line by adding a plus (+) before the #{deploy_branch} tag:
system "git push origin +#{deploy_branch}"
Run the command
rake deploy
It should succeed.
Undo the edit you made to the Rakefile!
Idea for this solution came from reading this: https://stackoverflow.com/a/9629458/1369730

I have the same problem when hosting my Octopress blog on github pages. I Googled a lot and finally solved this problem.
Just change the directory.
cd octopress/_deploy
git pull origin master
cd ..
rake deploy
Then it's fixed.

Related

Unable to discard changes in working directory

I have this file in working directory called Gemfile.lock. Basically, this file gets refreshed every time another file Gemfile gets modified. But I was able to
git stash
Gemfile but Gemfile.lock did not get put in stash. So then I tried
git checkout Gemfile.lock
and
git checkout -- Gemfile.lock
But everytime I run 'git status', it remains highlighted in red in the working directory. I do not want to add it to the staging area to be committed to my local repository and ultimately the remote repository. But I also want to
git checkout
to another branch. But this file being in the working directory is preventing me from switching branches. What can I do?
Keep in mind, I do not want to add this file to .gitignore and invoke 'git rm --cached <file-name>', because I do want this file to be tracked in git. I just do not want my current revision to be tracked.
I had a case where spring caused troubles. Never figured out what happened. Should you use rails with spring, then try spring stop first.

git clone --recurse-submodules fails silently

I have added a submodule to one of my repositories hosted on GitLab. In my browser GitLab displays the correct submodule#commit entry and the .gitmodules also looks okay. However, if I clone the repository using --recurse-submodules, the folder which should contain the submodule is empty.
I realize that this is impossible to diagnose without further information (which I cannot provide) but all I'd like to know here is how to go about debugging this myself since git fails to provide any information on what's gone wrong.
EDIT: I believe I've figured it out. I'm on Windows (which I forgot to tag, sorry about that) and my .gitmodules contained submodule paths using escaped backslashes (which I thought was correct), manually changing those to forward slashes fixed the problem.
You can try this after cloning you repository:
$ git submodule init
$ git submodule update --remote

The working copy <Project name> failed to commit files. - The repository has an uncompleted operation

I've just updated my Xcode from 6 to 7 (and code from Swift 1.2 to Swift 2.0) and try to create new branch in Xcode. After that I can't push my code to Bitbucket.
Is there a way how can I delete repository from directory and setup Bitbucket again and maybe push to another (a new one) repository? Fix of this problem will be great, but I will be satisfied even with move to another repository.
I had this error in xcode 7.1 on a year old project that was working fine. In my case I have a project with the default local repository created by xcode. For anyone who is not going to re-install and re-setup. It is possible to find out what the dangling command is and fix it from command line.
To find the dangling command Open Terminal from the project directory:
xcrun git status
In my case the status returned:
On branch master
You are currently rebasing.
(all conflicts fixed: run "git rebase --continue")
To fix the problem I used:
xcrun git rebase --skip
In my case I ran git status which revealed that You are currently bisecting. (I was doing a bisect and must had forgotten to reset). I did a git bisect reset and attached the head to my latest commit and it was all fine afterwards.
When I am merging from currentBranchA into branchB, I got conflicts,I didn't want to solve the conflicts immediately and quit the merging process. But when I try to merge again, the Xcode shows "The working copy is currently in the middle of another operation..."
I opened the terminal ,cd to the project directory, and check the git status:
git status
it shows:
On branch currentBranchA
Your branch is up to date with 'origin/currentBranchA'.
All conflicts fixed but you are still merging.
(use "git commit" to conclude merge)
Just do it as it says. Continue to input
git commit and click Ctrl + C to close the commit message window.
The problem will be zero.
The problem was with installation of GitHub. I had a master repository. After reinstall and resetup everything works like before.
EDIT: For anyone who has a problem with Xcode and GIT I have a best advice. Don't use it. Use for example Source Tree
When you start developing for a living, you are gonna have to use more reliable solution for GIT. Imagine you have 70 branches. Using Source Tree you can easily solve conflicts and other things about working in team. Xcode GIT solution is not reliable and you are gonna be only frustrated.

Issues with git branch checkout due to untracked working tree files

I thought I put the days of Xcode + git issues behind me. Guess not. I am getting this git error when trying to checkout another branch.
error: The following untracked working tree files would be overwritten by checkout:
RCAlpha.xcodeproj/project.xcworkspace/xcuserdata/andrewjl.xcuserdatad/UserInterfaceState.xcuserstate
RCAlpha.xcodeproj/xcuserdata/andrewjl.xcuserdatad/xcschemes/RCAlpha.xcscheme
RCAlpha.xcodeproj/xcuserdata/andrewjl.xcuserdatad/xcschemes/xcschememanagement.plist
Please move or remove them before you can switch branches.
Aborting
Very well I say, let me remove these files:
andrewjl$ git rm --cached RCAlpha.xcodeproj/project.xcworkspace/xcuserdata/andrewjl.xcuserdatad/UserInterfaceState.xcuserstate
fatal: pathspec 'RCAlpha.xcodeproj/project.xcworkspace/xcuserdata/andrewjl.xcuserdatad/UserInterfaceState.xcuserstate' did not match any files
At this point I'm not sure what to do. These files are all listed in my .gitignore and I also gave git clean -f -d a try as well. No dice. Anyone know what's going on here?
The files are untracked: git rm --cached cannot find them because there are not in the index. Just delete them, using your file manager or rm. Then checkout should work as expected. Note that git status will show you what git sees the files as (tracked, changed, untracked; with an additional option it will also display ignored files).
they arent in git but there locally .. that means when you switch those would be lost and git doesnt allow that
remove them locally:
rm RCAlpha.xcodeproj/project.xcworkspace/xcuserdata/andrewjl.xcuserdatad/UserInterfaceState.xcuserstate RCAlpha.xcodeproj/xcuserdata/andrewjl.xcuserdatad/xcschemes/RCAlpha.xcscheme RCAlpha.xcodeproj/xcuserdata/andrewjl.xcuserdatad/xcschemes/xcschememanagement.plist
they are recreated by xcode anyway. nothing important in there!
Try this
git rm --cache */xcschemes/xcschememanagement.plist
git commit -m "Good bye xcschememanagement.plist"
Git stash and git checkout "yourBranch"
git clean -f
solve the problem for me, they are untracked files when run clean they get remove.

Cloning repository from ruby

I'm creating a Sinatra app that will pull in data from a remote git repository.
I've taken a look at the ruby-git gem, but I get cannot load such file -- git on the line of require 'git'. The gem is installed and in my Gemfile.
I'm not sure if this is the correct way about going about this, but essentially I want the app to checkout a git repository for pulling in data.
Ended up using the system command:
system("git clone #{$config['repository']} content")

Resources