Reputation: 5262
I am the maintainer of an open source project hosted on GitHub (public repository).
Due to my current working pattern, I have to work on more than one device on the source code. That leads to situations where I have to switch between two devices in order to continue coding.
Back when I had a private repository I would just commit to the develop
branch (or any feature branch for that matter) and pushed to origin
on one device and pulled/rebased on the other one. No meaningful commit message, no build-able status on some occasions.
Now, working on a public repository I do not want to 'pollute' the branches so I wonder: What would be the best course of operation?
Is there anyone having good advice for me?
Upvotes: 0
Views: 66
Reputation: 12100
If you can create private GitHub repository:
example/example-private
$ git remote add origin-private https://github.com/example/example-private.git
$ git push origin-private
$ git checkout -b develop-private
$ git push -u origin-private develop-private`
Now you can share develop-private
with multiple devices via private repository.
develop-private
branch with your public develop branch.Upvotes: 2
Reputation: 389
So the problem is, you don't want to commit your undone work for example. If I were on your situation I would do this in this way.
git add .
git commit -m "work in progress, don't checkout from this commit
And when you are on another device, after downloading changes that you did on first device. I'll do.
git reset --soft HEAD~1
And in that way you have your work on another device and public repository is free of useless commit.
Upvotes: 0