tags:

views:

33

answers:

1

I'm looking to push my branch to a remote, but I don't wish to include all the files in the branch, but I do wish to keep track of them here.

Is there a way to do this with a filter, or do I need to create a new branch for this? All the stuff I've read seems to talk about completely removing the files, I just don't want them pushed.

A partial push - a nudge, if you like :)

+2  A: 

Partial pushes are not possible. The best you could do is create a new branch with the specific files and push it.

If partial pushes were possible, the remote branch and the local branch would have different SHA-1 IDs which clearly shows that the branches differ. Hence, create and push a new branch.

Alan Haggai Alavi
ok, thanks for clearing that up for me. I wasn't aware that the whole branch had a hash as well, I thought it was only the files, so thanks for that bit of info too.
Iain
You are welcome. :-)
Alan Haggai Alavi
@Iain: Pedantic note: it's not the branch that has a hash. It's the commit, to which the branch is a pointer. All *objects* (commits, trees, blobs) have hashes. See [git object model](http://book.git-scm.com/1_the_git_object_model.html) in the git community book.
Jefromi
@Jefromi and tags (I'm not sure if notes have SHA)
mathepic
@mathepic: Yes, and annotated tags - I was trying to keep it simple in the context of branch vs files having hashes. (Notes are, I believe, refs, with the information stored in the usual objects.)
Jefromi