DEV Community

Cover image for Common Git Commands and what they do
Odipo Otieno (KwargDevs)
Odipo Otieno (KwargDevs)

Posted on

2

Common Git Commands and what they do

  1. git init: Initializes a new Git repository.
  2. git clone: Creates a copy of a remote repository on your local machine.
  3. git add: Adds changes to the staging area, in preparation for a commit.
  4. git commit: Creates a new commit with the changes in the staging area.
  5. git status: Shows the status of the working directory, including changes that have been made but not yet committed.
  6. git log: Shows a log of all commits in the repository.
  7. git diff: Shows the differences between the working directory and the last commit.
  8. git branch: Shows a list of branches in the repository and indicates the current branch.
  9. git checkout: Allows you to switch between branches or restore files in your working directory to a specific commit.
  10. git merge: Merges changes from one branch into another.
  11. git pull: Fetches and merges changes from a remote repository into your local repository.
  12. git push: Pushes commits from your local repository to a remote repository.

Top comments (0)

typescript

11 Tips That Make You a Better Typescript Programmer

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay