Name a few git commands and explain their usage.
Answer / Deepak Aswal
Here are some commonly used Git commands:n1. `git init`: Initialize a new Git repository.n2. `git add <file>` or `git add .`: Stage changes to the Git index for future commit.n3. `git commit -m "<commit-message>"`: Commit staged changes with a message.n4. `git branch <branch-name>`: Create a new branch.n5. `git checkout <branch-name>`: Switch to another branch.n6. `git merge <branch-name>` or `git pull --rebase origin <branch-name>`: Merge changes from another branch into the current branch.n7. `git status`: Show the current state of the working directory and staged files.n8. `git log`: Display the commit history.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is a distributed vcs?
What is the common branching pattern in GIT?
What is git and why do we use it?
What does ‘hooks’ comprise of in git?
What is rebasing syntax in git?
Explain the difference between rebase and merge?
What is the purpose of branching in GIT?
How to squash or fixup commits?
How git instaweb is used?
What are the advantages of using GIT?
What is git bisect?
What is the function of ‘git rm’?