Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Experiment No.

3
To Perform various GIT operations on local and Remote repositories using GIT Cheat-Sheet.
Description:-
To perform various Git operations on local and remote repositories, you can refer to the Git Cheat-
Sheet. Here are some common Git operations and their corresponding commands:

1. Clone a repository:
git clone <repository_url>
2. Initialize a new repository:
git init
3. Check the status of your repository:
git status
4. Add changes to the staging area:
git add <file_name> # add a specific file
git add . # add all changes
5. Commit changes to the repository:
git commit -m "Commit message"
6. Push changes to a remote repository:
git push <remote_name> <branch_name>
7. Pull changes from a remote repository:
git pull <remote_name> <branch_name>
8. Create a new branch:
git branch <branch_name>
9. Switch to a different branch:
git checkout <branch_name>
10. Merge branches:
git merge <branch_name>
11. View commit history:
git log
12. Create a new remote repository:
git remote add <remote_name> <repository_url>
13. View remote repositories:
git remote -v
14. Fetch changes from a remote repository:
git fetch <remote_name>
15. Remove files from the repository:
git rm <file_name>

These are just a few examples of Git operations. The Git Cheat-Sheet provides a comprehensive list
of commands and their usage. You can refer to it for more detailed information on each operation.

You might also like