it is important to keep track of branches and make sure you are not working on the wrong branch. Git provides a number of useful commands to help you list branches and keep track of branches
# Select all of the snippets you don't want to save$ git stash drop 六、分支(Branches) 18、我从错误的分支拉取了内容,或把内容拉取到了错误的分支 这是另外一种使用git reflog情况,找到在这次错误拉(pull) 之前HEAD的指向。 (main)$ git reflog ab7555f HEAD@{0}: pull origin wrong-branch: Fa...
You also see a list of the remote branches. By executing thefetchcommand, this list is updated if there's a remote branch that isn't listed. In the next example, there's only the main branch on the local repository and the main on the remote repository. If there would be another remo...
To check what was previously committed and review its branch status within different branches using git commands, one can use thegit logcommand. The command will list all merged commitIDs against the intended branch-related refs, along with other helpful information. This includes the author details...
分支(Branches) 我从错误的分支拉取了内容,或把内容拉取到了错误的分支 这是另外一种使用git reflog情况,找到在这次错误拉(pull) 之前HEAD的指向。 (main)$ git reflog ab7555f HEAD@{0}: pull origin wrong-branch: Fast-forward c5bc55a HEAD@{1}: checkout: checkout message goes here ...
CommandDescription git branchList branches (the asterisk denotes the current branch) git branch -aList all branches (local and remote) git branch [branch name]Create a new branch git branch -d [branch name]Delete a branch git push origin --delete [branch name]Delete a remote branch ...
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]<command>[<args>] The most commonly used git commands are: add Add file contents to the index bisect Find by binary search the change that introduced a bug branch List, create, or delete branches ...
This command copies a Git branch. git push [remote repo] --delete [ branch name] Delete a remote Git branch, named in the last set of brackets. git checkout Use thegit checkoutcommand to navigate among the branches inside the repo you’re working in. ...
primary functions are to create, list, rename and delete branches. To operate further on the resulting branches the command is commonly used with other commands likegit checkout. Learn more aboutgit checkoutbranch operations; such as switching branches and merging branches, on thegit checkoutpage...
Branches Tags Configuration variables Lists all configuration variables. git config --list Lists only local configuration variables. git config --local -l Lists only system configuration variables. git config --system -l Lists only global configuration variables. git config --global -l Sets ...