Difference Between Stash vs Stage Files in Git
“Stash” is a process that saves untracked modified files into the stack. While the “Stage” is the step that adds the untracked files to the Git staging area.
Read More“Stash” is a process that saves untracked modified files into the stack. While the “Stage” is the step that adds the untracked files to the Git staging area.
Read More“git checkout ” is used to revert specific file changes in the current repository and “git checkout” is used to create and switch branches.
Read MoreTo undo the particular commit in Git, which is pushed to the remote repository, the “git reset” command can be used along with the specific “HEAD~” position.
Read MoreTo create branch and checkout using a single command, the “git checkout -b ” and “git switch -c ” commands are used.
Read MoreTo roll back to the last push to Git, first, go to a particular directory. Then, execute the “git reset –hard HEAD~1” command to undo the most recent push.
Read MorePractical tutorial on how the SSH key is set up on GitHub by creating repositories and generating an SSH key on our local machine using the Git command.
Read MoreTo squash commits after they have been pushed to the local repository, first, redirect to the local repository and run the “git rebase -i HEAD” command.
Read MoreTo search in commit messages using a command line, run the “git log –oneline –grep=<keyword>” command with different options according to the requirement.
Read MoreTo remove the Git tags that do not exist on the remote repository, first, delete all local tags and run the “git fetch –tags” command to fetch the remote tags.
Read MoreTo remove the remote tags, the “git push <remote-name> –delete $(git tag -l)” command and the “git tag -d $(git tag -l)” command is used to delete local tags.
Read MoreTo push the changes to a specific branch, first, go to the local repository and run the “git push <remote-name> <branchname>” command.
Read MoreTo pull specific directory, create sparse checkout through “git config core.sparsecheckout true” command. Run the “git pull <remote> <local-branch>” command.
Read MoreTo Git commit a whole folder, first, redirect to the required folder. Then, run the “git commit” command along with the folder path to commit the whole folder.
Read MoreTo perform Git pull without merging the remote branch, the “git pull –rebase” command can be used.
Read MoreTo rebase Git one branch on top of another branch, the “git rebase /” command can be used.
Read MoreTo get the shortest output from the git log containing the author and date, the “git log –pretty=format:”%h %an %ad” –date=short ” can be used.
Read MoreTo clone the specific version of remote repository, first, clone the remote repo into a specific folder, move to it, and run “git reset HEAD ” command.
Read MoreTo fix Git push ‘[remote rejected] main’ error, it is required to change the current working branch using the “git switch” or “git checkout” command.
Read MoreTo fix the “git: fatal: Could not read from remote repository” error, add the remote URL using the “git remote add <remote> <URL>” command.
Read MoreTo revert uncommitted changes, including files and folders, run the “git reset –hard HEAD” command in the Git bash terminal.
Read More