Any needs out there? I need your help please...

So, let’s say I have a repo that contains a folder called “example”. There are many other files and folders in this repo too.

Is it possible for me to run a git push command that ONLY pushes the contents of example to the root of the remote git repo?

So after I push /example/test.txt to my remote repo, it would be test.txt world be in the root of the repo, not /example.


@kev In short, no.

Your local repo is (presumably) a clone of that remote, so it doesn't make sense to think of making a change to the remote that isn't reflected in your local.

If you can make commits that get your local into the desired state, then of course you can push them, but if that fit your use case I presume you'd be doing that.

You might need to say more about your workflow, in order to get to a question that meets your need and works with Git with reasonable simplicity.

Sign in to participate in the conversation

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.