Created
March 17, 2023 07:28
-
-
Save codewithmanas/caa02633ee15d5c01000ee0504f3cc37 to your computer and use it in GitHub Desktop.
Revisions
-
codewithmanas created this gist
Mar 17, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ 1. `git init`: This command initializes a new Git repository in the current directory. 2. `git add`: This command adds changes to the staging area. You can specify individual files or use `.` to add all changes. `git add <file name>` (for a specific file) or `git add .` (for all files). 3. `git commit`: This command commits changes to the repository. You can add a message with the`-m` flag, like this: `git commit -m "Commit message"`. 4. `git status`: This command shows the status of your repository, including which files have been modified and which are staged for commit. 5. `git log`: This command shows the commit history of the repository, including who made each commit, when, and the commit message. 6. `git checkout`: This command allows you to switch between branches or restore a file to a previous version. You can also use it to create a new branch. `git checkout -b <new_branch>` (creates a new branch if not exist and switches to a new branch) `git checkout <existed_branch>` (if the branch already exists) 7. `git pull`: This command pulls changes from a remote repository into your local repository. 8. `git push`: This command pushes changes from your local repository to a remote repository. 9. `git branch`: This command shows the current branches in your repository. You can use it to create a new branch or delete an existing one. 10. `git clone`: This command clones a remote repository onto your local machine.