Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
dev:howto:git [2009/08/14 00:40] – add info about push.default kelnos | dev:howto:git [2009/08/14 04:26] – kelnos | ||
---|---|---|---|
Line 93: | Line 93: | ||
===== Tips and Tricks ===== | ===== Tips and Tricks ===== | ||
- | ==== Shortcut URLS ==== | + | See [[dev:howto:git-tips-and-tricks]]. |
- | + | ||
- | If you clone a lot of Xfce repositories, | + | |
- | + | ||
- | < | + | |
- | + | ||
- | After this, you'll be able to do, for example: | + | |
- | + | ||
- | < | + | |
- | + | ||
- | and Git will automatically rewrite it to the correct URL. You can of course do this with git: and http: URLs as well. | + | |
- | + | ||
- | ==== Different Local Username? ==== | + | |
- | + | ||
- | If your ssh username is not the same as your local username, you can make an entry in '' | + | |
- | + | ||
- | < | + | |
- | User $USERNAME</ | + | |
- | + | ||
- | Of course, replace '' | + | |
- | + | ||
- | ==== Branch Auto-pushing ==== | + | |
- | + | ||
- | If you have a relatively new version of Git on your machine, you may get this message after running '' | + | |
- | + | ||
- | < | + | |
- | warning: has not configured any push refspecs. The default action in this | + | |
- | warning: case is to push all matching refspecs, that is, all branches | + | |
- | warning: that exist both locally and remotely will be updated. | + | |
- | warning: not necessarily be what you want to happen. | + | |
- | warning: | + | |
- | warning: You can specify what action you want to take in this case, and | + | |
- | warning: avoid seeing this message again, by configuring ' | + | |
- | warning: | + | |
- | warning: | + | |
- | warning: | + | |
- | warning: | + | |
- | + | ||
- | This warning is harmless, but you might want to change the value both to make your pushes " | + | |
- | + | ||
- | < | + | |
- | + | ||
- | My rationale here is: | + | |
- | - Using ' | + | |
- | - Using ' | + | |
- | - Using ' | + | |
- | - Using ' | + | |
===== Migrating From git-svn Clones ===== | ===== Migrating From git-svn Clones ===== | ||
Line 154: | Line 108: | ||
$ git checkout master | $ git checkout master | ||
$ git checkout -b new-drawing | $ git checkout -b new-drawing | ||
- | $ git pull ../ | + | $ git fetch ../ |
- | $ git reset --hard new-drawing | + | |
$ git log tmpbranch</ | $ git log tmpbranch</ | ||
Line 169: | Line 122: | ||
< | < | ||
$ git cherry-pick e3633d52774bd9a2a20ef9af37d3f72f964a2f54</ | $ git cherry-pick e3633d52774bd9a2a20ef9af37d3f72f964a2f54</ | ||
+ | |||
+ | (Note: if there' | ||
Now, if I got any merge errors after one of the cherry pick commands, I'd have to stop there and fix it up first: | Now, if I got any merge errors after one of the cherry pick commands, I'd have to stop there and fix it up first: | ||
Line 187: | Line 142: | ||
You'll have to repeat this process for any other local branch you have in the old git-svn clone. | You'll have to repeat this process for any other local branch you have in the old git-svn clone. | ||
+ | |||
+ | After you finish with all branches in a particular module, you may want to run: | ||
+ | |||
+ | < | ||
+ | |||
+ | This will remove all the dangling commits, trees, and blobs left over from the probably-large number of mismatched objects discarded when you deleted tmpbranch. |