Skip to content

adamek-c/git-exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-exercises

Git is awesome repo is used to learn git

Useful commands:

  • mkdir - create folder
  • touch - create file
  • ls - informations about files
  • git status - state of the working directiory and the staging area
  • git diff - shows changes between commits and working tree
  • git restore - restore working tree file (when you delete somthing and you want it back)
  • git pull - fetch from a local branch
  • git show - show various type objects
  • vi - create file and add contect for example (vi -> press I on keyboard and add some contect -> press Esc -> :wq)
  • git add -A - add all files width all dir
  • git add . - git add one file
  • git commit -m - add commit
  • git commit --amend -m - edit your last commit and save the commit
  • git rm --cached - remove one file for example (maybe you want to added new entries in your gitignore)
  • git rm -r --cached - the same effect like above + remove all files
What about copy and paste
  • To copy use command Ctrl + Insert

  • To paste use command Shift + Insert

  • To clean gitbash use command Ctrl + L

Branch :

  • git branch - list all of the branches in your repository local machine
  • git branch -r - list of the branches in remote server
  • git branch -a - branch one of github
  • git branch create_new_branch - create new branch
  • git branch checkout create_new_branch - switch new branch
  • git checkout - - switch previous one
  • git branch -b create_new_branch - create new brach and switch
  • git branch -d create_new_branch - delete branch

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published