2

Working on a project in IntelliJ and pushing/pulling all material to github.

Suddenly it stops working: I tried to fetch the code from github and get the error message: Fetch failed Error: option 'timeout' expects a numerical value

Similar error messages have occurred whenever I tried to push, but ultimately the push always went through. Until now, when I suddenly get the message

Push rejected Master: rejected

I'm really inexperienced with git, any answers are helpful!

cd coding
git pull

Please specify which branch you want to merge with.
See git-pull(1) for details

git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream master origin/<branch>

When I try to pull and

git push
error: option `timeout' expects a numerical value
usage: git credential-cache [options] <action>

--timeout <n>         number of seconds to cache credentials
--socket <path>       path of cache-daemon socket

Everything up-to-date

The problem is everything ISN'T up to date

Hey guys, appreciate all the help, turned out that the error was something very simple that was overlooked during the setup of git on my machine.

https://help.github.com/articles/set-up-git

If anyone else has problems like the ones mentioned above, there's one thing you can try. Afterwards a pull-merge and then push worked fine.

scibor
  • 875
  • 4
  • 10
  • 21

2 Answers2

2

If something related to GitHub suddenly stop working, then it is probably linked to its status.

6:24 UTC A small percentage of repositories are currently unavailable while we perform maintenance.

If it does persist though, then it could be related with some local configuration issue.

For instance, check git status and git branch, making sure you are on a branch, and not in a detached HEAD mode.

If git status mentions files to be committed (ie they have been added to the index but not yet registered ion a commit), do a git commit after your git add.

If git branch doesn't return anything, then you need to follow "Git: How can I reconcile detached HEAD with master/origin?"

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • Started having these problems yesterday though – scibor Jun 11 '13 at 14:08
  • @scibor are you in a detached head branch like my edited answer suggests? – VonC Jun 11 '13 at 14:12
  • That seems like it could be the problem, but I'm really not sure how to check, could you maybe elaborate a bit? Sorry, I'm just really new to git – scibor Jun 11 '13 at 14:18
  • @scibor if git status returns "no branch", with a list of branch without one with a '`*`' in front of it, you are in a detached head. See the link in my answer. And then http://stackoverflow.com/questions/471300/git-switch-branch-without-detaching-head to solve this. – VonC Jun 11 '13 at 14:37
  • Typing git status yielded Initial Commit -> Changes to be committed ->list of files – scibor Jun 11 '13 at 14:39
  • Typed "git branch" no output – scibor Jun 11 '13 at 14:41
  • @scibor I have edited the answer, with a link to http://stackoverflow.com/questions/5772192/git-how-can-i-reconcile-detached-head-with-master-origin in order to reconcile the detached head with a branch. It is strange that you have no *local* branch though. `git branch -a` should list your remote branch(es) as well, assuming your local repo is the clone of a github repo. – VonC Jun 11 '13 at 14:52
0

I think you should set a timeout like:

git config credential.helper 'cache --timeout == 3600'