First - I don’t like and don’t understand Git. Second - I don’t have that much time to learn it. Sorry, but such people exist.
In Mercurial to start working on a new patch I usually do:
hg clone local-clone new-patch-clone cd new-patch-clone vim scripts/linux/template/Makefile hg ci hg push
Pretty intuitive, no? This will push the patch to local-clone. If you have rights to push upstream, you can cd to local-clone and invoke
hg push there. That’s all to make your patch shared.
Before anybody will teach their ways, I must say about my workflow. I usually work on several features at once and keep each feature in its own directory. I don’t like to waste energy with command line tools each time I need to check which feature is currently available in current checkout. My editor shows me the current path and that is more than enough.
Now I am trying to do the same with Git:
git clone openFrameworks ofg cd ofg vim scripts/linux/template/Makefile git ci git: 'ci' is not a git command. See 'git --help'. ... git commit git push ... remote: error: refusing to update checked out branch: refs/heads/master remote: error: By default, updating the current branch in a non-bare repository remote: error: is denied, because it will make the index and work tree inconsistent remote: error: with what you pushed, and will require 'git reset --hard' to match remote: error: the work tree to HEAD. remote: error: remote: error: You can set 'receive.denyCurrentBranch' configuration variable to remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into remote: error: its current branch; however, this is not recommended unless you remote: error: arranged to update its work tree to match what you pushed in some remote: error: other way. remote: error: remote: error: To squelch this message and still keep the default behaviour, set remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'. To /home/user07/openFrameworks/ ! [remote rejected] master -> master (branch is currently checked out) error: failed to push some refs to '/home/user07/openFrameworks/'
WTF? No, bad question. What should I type now to push my change to local clone at openFrameworks/ and then to GitHub to create a pull request for review? I can’t push from ofp/, because it was cloned from local copy and doesn’t know about remote and I don’t feel like copy/pasting GitHub URL every time I need to push there.