Configure
Global user name (i.e. for every repository on your computer)
To set the global user name :
$> git config --global user.name "John Doe" |
$> git config --global user.name "John Doe"
To check the global user name :
$>git config --global user.name
John Doe |
$>git config --global user.name
John Doe
Local user name (i.e. only for this repository)
To set the local user name :
$> git config user.name "John Doe" |
$> git config user.name "John Doe"
To check the local user name :
$>git config user.name
John Doe |
$>git config user.name
John Doe
Working Area
Clone repository
$>git clone http://srv-scm/git/myrepo.git |
$>git clone http://srv-scm/git/myrepo.git
Init repository
$>git init myrepo
Initialized empty Git repository in /opt/git/myrepo/.git/ |
$>git init myrepo
Initialized empty Git repository in /opt/git/myrepo/.git/
Local actions
Switch branch
$>git checkout myexistingbranch |
$>git checkout myexistingbranch
Create a new branch
$>git checkout -b newbranch |
$>git checkout -b newbranch
Publication server actions
Clone repository
$>git clone http://srv-scm/git/myrepo.git |
$>git clone http://srv-scm/git/myrepo.git
Fetch repository
Pull repository
git pull = git fetch followed by git merge FETCH_HEAD
Push repository