0% found this document useful (0 votes)
11 views

basic_git_commands

commands

Uploaded by

Ketan Thombare
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

basic_git_commands

commands

Uploaded by

Ketan Thombare
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

# Basic Git Commands

1. **git init**
- Initializes a new Git repository.

2. **git clone <repository-url>**


- Clones a repository into a new directory.

3. **git status**
- Displays the state of the working directory and staging area.

4. **git add <file-name>**


- Adds a file to the staging area.

5. **git commit -m "<commit-message>"**


- Records changes to the repository with a message.

6. **git push origin <branch-name>**


- Pushes changes to the remote repository.

7. **git pull origin <branch-name>**


- Fetches and merges changes from the remote repository.

8. **git branch**
- Lists all branches in the repository.

9. **git checkout <branch-name>**


- Switches to a specified branch.

10. **git merge <branch-name>**


- Merges a specified branch into the current branch.

11. **git log**


- Displays the commit history.

12. **git diff**


- Shows changes between commits, commit and working tree, etc.

13. **git remote -v**


- Displays the remote repository URLs.

14. **git stash**


- Stashes changes in the working directory.

15. **git reset --hard**


- Resets the working directory to the last commit.

16. **git fetch**


- Fetches changes from the remote repository without merging.

You might also like