Git: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
=== TASKS === | === TASKS === | ||
{| class="mw-collapsible mw-collapsed wikitable" | |||
! git merging conflicts after diverging | |||
|- | |||
| Revert local changes in a file to HEAD | |||
git checkout -- path/to/file.txt | |||
Discard ALL LOCAL COMMITS and get the (possibly diverged) remote instead | |||
git reset --hard origin/master | |||
|} | |||
{| class="mw-collapsible mw-collapsed wikitable" | {| class="mw-collapsible mw-collapsed wikitable" | ||
! git create new branch on server, pull to client | ! git create new branch on server, pull to client | ||
Line 67: | Line 75: | ||
git checkout master | git checkout master | ||
git branch -u origin/master master | git branch -u origin/master master | ||
|} | |} | ||
Line 96: | Line 95: | ||
Then you can clean up old branches like daily and daily_grind, as needed. | Then you can clean up old branches like daily and daily_grind, as needed. | ||
|} | |} | ||
{| class="mw-collapsible mw-collapsed wikitable" | {| class="mw-collapsible mw-collapsed wikitable" | ||
! git create merge-to command | ! git create merge-to command | ||
Line 175: | Line 172: | ||
| | | | ||
git config --global push.default current | git config --global push.default current | ||
|} | |||
{| class="mw-collapsible mw-collapsed wikitable" | |||
! git multiple upstreams | |||
|- | |||
| Use this to cause AUTOMATIC push/pull to a second origin: | |||
git remote set-url origin --push --add user1@repo1 | |||
git remote set-url origin --push --add user2@repo2 | |||
git remote -v show | |||
Leave out --push if you want to pull as well... but I'd be careful, it's better if code is changed in one client with this config, and then pushed to the multiple origins from there. Otherwise, things are GOING TO GET SYNCY-STINKY. | |||
|} | |} | ||
Revision as of 13:35, 13 April 2016
TASKS
Expandgit merging conflicts after diverging |
---|
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 |
---|
CONFIGURATION
Expandgit convert to a bare repo |
---|
Expandgit create merge-to command |
---|
Expandgit fix github diverge from local bare repo following README.md edit |
---|
Expandgit use kdiff3 as difftool and mergetool |
---|
Expandgit windows configure notepad++ editor |
---|
Expandgit fix push behavior - ONLY PUSH CURRENT doh |
---|
Expandgit multiple upstreams |
---|
From here...