Git: Difference between revisions
No edit summary |
No edit summary |
||
Line 144: | Line 144: | ||
----------------------------------------- | ----------------------------------------- | ||
|} | |} | ||
{| class="mw-collapsible mw-collapsed wikitable" | |||
! git branch rebase to keep master intact | |||
|- | |||
| Basically you want to rebase your branch using master. Simple enough, devil in the details. You should maintain a clean master branch that can be updated at any time, and a branch for your custom work that can be rebased at any time. | |||
Example: | |||
# on other: update the master branch with other users' changes | |||
# on gold: | |||
git checkout master && git pull # should always be a ff | |||
git checkout US290016 | |||
git rebase -i master # you'll possibly get merge conflicts | |||
git mergetool # fix it up - this will show you REMOTE head, LOCAL head, and BASE common ancestor | |||
git rebase --continue # AHA this will tell you you are only partially through, see the commit #comments for details | |||
git push --force # AHA this fails if remote does not allow it! | |||
# change remote config, if you get: remote: error: denying non-fast-forward refs/heads/US290016 | |||
# then you need to go to remote and change config | |||
# see https://stackoverflow.com/questions/10544139/how-to-force-push-a-reset-to-remote-repository | |||
git config receive.denynonfastforwards false | |||
# on other: reset US290016 | |||
# reset to the commit for the last known base ancestor (or earlier, doesn't hurt) | |||
git reset --hard 96ba297 | |||
git pull --rebase # rebase should not be needed, it should be a ff, but just in case use it | |||
|} | |||
=== CONFIGURATION === | === CONFIGURATION === |
Revision as of 16:02, 1 December 2017
TASKS
Expandgit new shared central bare repo |
---|
Expandcreate shared central repo for existing code |
---|
Expandgit merging conflicts after diverging |
---|
Expandgetting upstream commits into your GitHub fork |
---|
Expandgit create new branch on server, pull to client |
---|
Expandgit pull when untracked files are in the way |
---|
Expandgit create new branch when untracked files are in the way |
---|
Expandgit recreate repo |
---|
Expandgit connect to origin after the fact |
---|
Expandgit ignore local and remote changes to a file |
---|
Expandgit branch rebase to keep master intact |
---|
CONFIGURATION
Expandgit visual difftool and mergetool setup |
---|
Expandgit convert to a bare repo |
---|
Expandgit convert bare to a mirror of remote (github, facebook, etc) |
---|
Expandgit create merge-to command |
---|
Expandgit fix github diverge from local bare repo following README.md edit |
---|
Expandgit windows configure notepad++ editor |
---|
Expandgit fix push behavior - ONLY PUSH CURRENT doh |
---|
Expandgit multiple upstreams |
---|
From here...