Skip to content

franklinobiukwu/git_practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

  1. git init
  2. git config --global user.name "franklinobiukwu"
  3. git config --global user.email "[email protected]"
  4. git config color.ui auto
  5. git status
  6. git add {filename}
  7. git add . (adds all files to staging area)
  8. git commit -m "message"
  • git rm --cashed (filename) -> uncommit file

  • git log

  • git show (hash)

  • git diff -> difference between what you have in the current directory and what you have committed

  • q -> quit

  • git restore (filename) -> restores file from initial commit

  • git commit --amend -m "message" -> To ammend your commit message

  • git branch --> list all branches

  • git branch -M (new name) -> rename branch

  • git push -u origin (branch name) -> push to remote repository (main)

  • git remote add origin (remote repostiory) -> add/link remote repository to local repository

  • git pull

  • git branch -> Know what barnches are available on your local machine

  • git branch -r -> Know what barnches are available on your remote machine (-r -> remote)

  • git branch -a -> Know what barnches are available on both your remote and local machine (-a -> all)

  • git branch (new branch name) -> Create new branch

  • git checkout (branch name) -> switch between branches

  • git checkout - -> switch to previous branch

  • git checkout -b (branch name) -> Creates new branch and switch to it.

  • git branch -d (branch name) -> to delet branch (-d -> delete)

  • git merge (branch name) -> Merge branch to origin

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published