git:git_cheatsheet
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
git:git_cheatsheet [2015/02/22 13:59] – deva | git:git_cheatsheet [2017/02/21 20:20] (current) – deva | ||
---|---|---|---|
Line 85: | Line 85: | ||
</ | </ | ||
+ | ====Create branch==== | ||
+ | Create and switch to: | ||
+ | < | ||
+ | git checkout -b [branchname] | ||
+ | </ | ||
+ | |||
+ | Just create: | ||
+ | < | ||
+ | git branch [branchname] | ||
+ | </ | ||
+ | |||
+ | Push to server: | ||
+ | < | ||
+ | git push -u origin [branchname] | ||
+ | </ | ||
====Switch to branch==== | ====Switch to branch==== | ||
< | < | ||
Line 96: | Line 111: | ||
</ | </ | ||
+ | ====Fecth branches from server==== | ||
+ | < | ||
+ | git fetch --all | ||
+ | </ | ||
=====CVS 2 GIT===== | =====CVS 2 GIT===== | ||
< | < | ||
Line 122: | Line 141: | ||
</ | </ | ||
NOTE: If this is done by the usual 'git push' command, a 'No refs in common and none specified; doing nothing.' | NOTE: If this is done by the usual 'git push' command, a 'No refs in common and none specified; doing nothing.' | ||
+ | |||
+ | =====Set up repository mirror===== | ||
+ | From: https:// | ||
+ | < | ||
+ | # Create a bare clone of the repository. | ||
+ | git clone --bare https:// | ||
+ | |||
+ | # Mirror-push to the new repository. | ||
+ | cd old-repository.git | ||
+ | git push --mirror https:// | ||
+ | </ | ||
=====Move single directory to its own repository===== | =====Move single directory to its own repository===== |
git/git_cheatsheet.1424609976.txt.gz · Last modified: 2015/02/22 13:59 by deva