Más contenido relacionado
La actualidad más candente (20)
Similar a Git basics (20)
Git basics
- 4. How to install Git
• Recommended method is to download CLI tool https://git-
scm.com/downloads
• Check it works by typing git into terminal
- 6. How to start
Start your own repository
> git init
Start with some else’s repository
> git clone
- 7. Saving files
• Adding to staging area
• > git add <files> or
• > git add –all or
• > git add .
• Saving to local repo
• > git commit
• Saving to remote repo ( external or internal )
- > git push
- 8. Branches
• Movable pointer to a commit
• > git branch <new-branch-name>
• > git checkout <existing-branch-name>
• > git merge <other-branch-name>
- 9. DEMO
• Try the following list of commands
• What happens on each step
- 10. DEMO ( cont )
• > git clone https://github.com/agbenu/DemonstrationOnGit.git
• > cd DemonstrationOnGit
• > git status
• > git checkout -b my-new-feature
• Edit something in the file
• > git status
• > git add --all
• > git status
• > git diff HEAD
• > git commit -m “Made changes to file”
• > git status
• > git log
• > git push origin HEAD
• > git checkout master
• > git pull