About the author : Saksham K

1. git init
Initializes a new Git repository

2. git add
Adds files to the staging area. You can use ‘git add .’ to add all modified files.

3. git reset
Undoes the changes to the local files, restores to the last commit.

4. git diff
Displays the difference between files in two commits or between a commit and your current repository.

5. git status
It is used to check the state of the staging area and the working directory.

6. git commit -m “message”
This command is used to commit files (locally) on the repository.

7. git log
It is used to view the entire commit history.

8. git clone
Used to download existing code from a remote repository.

9. git branch
Used to list all the local branches on the machine.

10. git branch
Used to create a new branch locally.

11. git branch -d
Used to delete a branch.

12. git branch -m
Used to rename the current working branch.

13. git merge
Merges the provided branch with the current working branch.

14. git checkout
Used to switch from current branch to another one.

15. git checkout -b
Creates a new branch and switches to the new one.

16. git push
Used to save all commits to the remote repository.

17. git pull
Used to pull down all the updates rom the remote repository.

18. git rm
Used to remove a file from the working directory.

19. git stash
It is used to temporarily remove uncommitted changes.

20. Removing Git
from a project If you want to remove Git entirely from a project, just open the directory, make sure you are able to view hidden files, and delete the ‘.git’ folder.

About the author : Saksham K

Leave A Comment