Thomson
Thomson

Reputation: 21664

Clone staged files in original repository via git clone?

Seems staged files are also stored in the object tree, is it possible to include such staged files in origin repository via git clone?

Upvotes: 0

Views: 417

Answers (1)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 522181

If you would like to make your staged changes available in the remote repository, you could commit the staged changes, push to origin, and then revert back to staging:

git commit -m 'Temporarily commit staged files for cloning'
git push origin your_branch
git reset --soft HEAD^

Now the remote has your staged changes for others to use, but the working branch your_branch on your machine is in the same state whence you began.

Upvotes: 1

Related Questions