Git: Difference between revisions
No edit summary |
No edit summary |
||
Line 89: | Line 89: | ||
! Work with two local repos | ! Work with two local repos | ||
|- | |- | ||
| Set up a remote, then fetch it. | | Set up a remote, then fetch it as master. | ||
cd repoToChange | cd repoToChange | ||
git remote add otherplace ../../wherever/../gitrepo | git remote add otherplace ../../wherever/../gitrepo | ||
Line 95: | Line 95: | ||
git fetch otherplace # gets it all | git fetch otherplace # gets it all | ||
git checkout --track otherplace/master # or other branch as needed; this creates the branch and sets remote in one step, cool | git checkout --track otherplace/master # or other branch as needed; this creates the branch and sets remote in one step, cool | ||
| Set up a remote, then fetch it into a non-master branch, and push it to the active origin. | |||
cd repoToChange | |||
git remote add otherplace ../../wherever/../gitrepo | |||
git ls-remote otherplace # verify it looks ok, figure out which branch you like (if not master) | |||
git fetch otherplace # gets it all | |||
git checkout otherplace/master # creates it detached, good because we need to name the new branch something other than master | |||
git checkout -b new_otherplace_branchname # creates new local branch with a good name | |||
git push --set-upstream origin new_otherplace_branchname # takes the branch from the OLD origin and pushes it to the ACTIVE origin, cool! | |||
|} | |} | ||
{| class="mw-collapsible mw-collapsed wikitable" | {| class="mw-collapsible mw-collapsed wikitable" |
Revision as of 15:35, 13 July 2018
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 remove old branches |
---|
ExpandWork with two local repos |
---|
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...