Sign-up for GitHub.com
git
git help tutorial
| git command | Definition |
|---|---|
clone |
Clone a repository into a new directory |
init |
Create an empty Git repository or reinitialize an existing one |
add |
Add file contents to the index |
status |
Show the working tree status |
commit |
Record changes to the repository |
fetch |
Download objects and refs from another repository |
pull |
Fetch from and integrate with another repository or a local branch |
push |
Update remote refs along with associated objects |
[Windows, Linux & Mac]
git config --global user.name "Your Name Comes Here" git config --global user.email you@yourdomain.example.com
[Windows]
git config --global credential.helper wincred
[Windows, Linux & Mac] Turn on the credential helper so that Git will save your password in memory for some time. By default, Git will cache your password for 15 minutes.
git config --global credential.helper cache
To change the default password cache timeout
git config --global credential.helper 'cache --timeout=3600'
mkdir Repository\CosFNL\GitIntro
mkdir -p ~/Repository/CosFNL/GitIntro
cd Repository\CosFNL\GitIntrocd Repository/CosFNL/GitIntro/git init
Initialized empty Git repository...
git add Readme.md
git commit -m "First commit"
[master (root-commit) 873e7b8] First commit
1 file changed, 117 insertions(+)
create mode 100644 Readme.md
git remote add origin https://github.com/CosFNL/GitIntro.git
git push -u origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 1.21 KiB | 1.21 MiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote:
remote: Create a pull request for 'master' on GitHub by visiting:
remote: https://github.com/CosFNL/GitIntro/pull/new/master
remote:
To https://github.com/CosFNL/GitIntro.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
https://github.com/CosFNL/GitIntro.git
…or create a new repository on the command line echo "# GitIntro" >> README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/CosFNL/GitIntro.git git push -u origin master
…or push an existing repository from the command line git remote add origin https://github.com/CosFNL/GitIntro.git git push -u origin master
…or import code from another repository You can initialize this repository with code from a Subversion, Mercurial, or TFS project.