2

Is it possible to take a local file and add it straight to a remote repo with git?

Say I have a file that is not in a local working tree or anything and I want it added to the remote working tree.

Essentially I don't want a local branch to work on.

Darcys22
  • 1,204
  • 2
  • 11
  • 20
  • 3
    why don't you spend 20s on adding it and just pushing it to the remote? – AD7six Jun 11 '13 at 09:00
  • If you don't want a local branch, then you should use a centralized version control system like SVN. – thSoft Jun 11 '13 at 09:01
  • @AD7six but the question stands. Maybe the working tree is several GBs and OP doesn't have enough hdd space(or something else, logical and technical) and just wants to create a commit which pushes a file into the remote – Bleeding Fingers Jun 11 '13 at 09:08
  • @hus787 I'd rather know there's a valid reason os opposed to "I just want to do it differently"; Or to know the _real_ problem that's is trying to be fixed/addressed. – AD7six Jun 11 '13 at 09:09
  • in all case a `commit` or `commit --amend` is necessitated and can't be avoided. – Bleeding Fingers Jun 11 '13 at 09:10
  • @kostix quite similar but not duplicate. This one says "add" and that says "update" – Bleeding Fingers Jun 11 '13 at 09:14
  • it's pretty much what @hus787 said. The remote tree is being used as a website and each file is an individual post. I want to make a post (as an individual file) push it to the remote repo without having the several hundred individual posts on my laptop – Darcys22 Jun 11 '13 at 09:16
  • 1
    @Darcys22 if you don't really want to use git locally - why don't you sftp the file to the website and add it there? – AD7six Jun 11 '13 at 09:21
  • 1
    @Darcys22 I suggest you update your question stating that precisely. – Bleeding Fingers Jun 11 '13 at 09:21
  • @AD7six that is what I was originally going to do. The server is to be set up as a git repo anyway and was wondering if there was another way – Darcys22 Jun 11 '13 at 09:28
  • @hus787, I meant that the situation is not really different: the OP wants to forfeit one of the core properties of a DVCS, and the thread I linked to discusses why this is a strange idea, plus a last-resort workaround. – kostix Jun 11 '13 at 10:14

0 Answers0