Use Git for version management

Common sense

  • Several states for a file: Unmodified (Modified, now the file is in the working directory), Modified (Staged, now the file is in Staged), Staged (submitted, now the file is in the version warehouse)
  • If you need help with the git command on the terminal, you can add it directly after the command-hYou can view the command instruction

Document status: Basic content complete, in detail adjustment.

Git basic operations

Begin to use

Git basic configuration

Git’s basic configuration is divided into three scopes

  • Local: applies only to the current version of the repository. The configuration location is. Git /config
  • Global: valid for all repositories of the logged-in user, configuration file in the user’s home directory (Windows is C:\Users\userName. Gitconfig)
  • System: applies to all users of the system

You can also use a text editor to open the corresponding configuration file without using the following command. Ensure that the format of the configuration file is correct. In this way, configuration items can be modified faster. However, it is recommended to use the following command to prevent incorrect operations. Config priority: local>global>system

git config --global user.name 'name'
git config --global user.email 'email@email'

Git config
git config --list --local
git config --list --global
git config --list --system

git config --local user.name User.name = user.name

Set to local by default
git config --local 
git config --global
git config --system

# remove
git config --unset --local user.name
git config --unset --global user.name
git config --unset --system user.name


The git EDITOR defaults to using the software specified by the shell environment variable $EDITOR. For general vim/emacs, you can change the default editor under the terminal to vim by using the following command:
git config --global core.editor vim 

Git configures the terminal color
$ git config --global color.ui true
Copy the code



Create a git repository in the root directory of your project
git init

# No project code
cdGit init projectCreate a folder in the current directory with the same name as the project name
cd project
Copy the code

Ignore some files

Within the project, some files, such as common third-party dependencies or build-generated files, can be installed or built, which we do not normally include in our repository. This can be done by adding a.gitignore file to the root of the project. The content of the file is as follows.

doc # will not manage everything in the doc folder, nor will it manage doc files
doc/ Only files in the doc folder are ignored

The following is usually added to front-end projects
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log
Copy the code

Some ides often have plug-ins that help you add Gitignore more quickly. Jetbrains, for example, can easily add Gitignore via plug-ins

Git alias

Git can alias common commands to improve terminal use efficiency

git config --global alias.co checkout
git config --global alias.unstage 'reset HEAD --'
git config --global alias.visual '! gitk'Execute external command +!Copy the code

Git workflow

  1. Add or modify files in a directory
  2. Place files that need to be versioned in the staging area
  3. Commit the files for the staging area to the Git repository

Add the file to the staging area

git add . Keep track of all files in the current directory
git add fileA fileB # trace fileA and fileB files
git add -u Add changes to all traced files to the staging area
Copy the code

Commit staging content to git repository

The commit message should be as meaningful as possible so that we can understand what the change does. Git reflog does not know what we are doing with each git operation

If git message is too long, use this command to open the editor.
git commit

Git commits messages with a small number of messages
git commit -m 'message'

# Does not apply to newly added files that have not yet been traced in the workspace.
git commit -a -m 'message'Or git commit - am'message' 

Add code to the previous commit id without adding a new commit ID
git commit --amend

# View help
git commit --help

Amend the author of the historical submission record by Amend
git commit --amend --author="name <[email protected]>"

If you want to reset the author to the current author, this command is recommended for convenience
git commit --amend --reset-author

Ignore verification of code when committing to Git, such as configuring code to commit only if it passes ESLint or unit tests
git commit -m "commit -message" --no-verify

git commit --amend --reuse-message=

git commit --amend --reedit-message=
Copy the code

Git tag

Git is tagged for a commit. Tagging is usually carried out with the release. Through Git tagging, we can more conveniently carry out version checking and rollback operations, which is also a very important link.

Git tag // Lists existing tags git tag -l'v1.8.5'Git tag-a v1.4-m git tag-a v1.4-m git tag-a v1.4-m'message'Git show [hash] git tag v1.4 / / git lightweight tag tag - a v1.2 9 fceb02 / / for a commit tagging * * * * * * * * * * * * * * * * * * to share, ******************** git push will not push tags to remote repositories git push Origin v1.5 // Tags must show push git psuh Origin --tags // Push all * * * * * * * * * * * * * * * * * * * check out * * * * * * * * * * * * * * * * * * * * git checkout/tag / / check out a tag / / will be in a state of separation head pointer, and submit at this time do not belong to any branch, If you need to modify the new branch git checkout - b version2 v2.0.0 / / on a particular tag to create a new branch of * * * * * * * * * * * * * * * * * * delete the tag * * * * * * * * * * * * * * * * * * * * * * git tag - d V1.4 Git Push Origin: Refs /tags/ V.14Copy the code

branch

Branches are a very important concept for Git, and we often create new branches on top of the main branch for our own development or bug fixes. We then wait for development to be completed and verified before merging our new features or bug changes into the main repository by merging branches

git branch branchName

git branch -v # Look at local branches

git log--oneline --decorate // Check the objects that each branch refers to. git checkout branchName git checkout -b branchName gitlog--oneline -- class --graph --all // Outputs the submit history, the direction of each branch, and the matching of project branches. A Git branch is essentially a file that contains the checksum of the object in question (a sha-1 value string of length 40). Git branch -d branchName Git branch -d branchName Git merge branchName Branch merge automatically selects a commit as a common ancestor as the base branch conflict for merge: 1. Use Git merge --abort to force the merge, and use Git add fileName to flag resolved conflicts. Git branch --merged or git branch --no-merged displays merged or unmerged branches. Use git branch -d branchName to delete branches that have not been merged. Git branch -m oldName newNameCopy the code

Branch development workflow

Remote branch

A remote reference is a reference (pointer) to a remote repository, containing branch labels, and so on. Git ls-remote displays the complete list of remote references, Git branch –set-upstream branch-name Origin /branch-name Associates a local branch with a remote branch

View the version repository

Viewing the Current Status

You can use this command to check the current state of your Git repository, such as what changes you made to your workspace and repository, or which branch you are currently in.

Git status git status --short or git status -s A new file that is not traced is added. //A new file added to the staging area // right side of M, modified not to the staging area // left side of M, modified and put into the staging area.Copy the code

Compare differences between versions

With git’s git diff command, you can compare any file between two commits.

Git diff j f b d u key control page flip g g first line, last line 3g jump to third line/or? + keyword up to down, down to up search, highlighted is matching n next n on the previous input H help document q exit

git diff   # Workspaces and staging areas.

git diff --cached / git diff staged  Staging area and version libraryGit diff -- file name# Specific file differences can be multiple files

git diff masterA materB  # Compare any two branches

git diff [old-commit] [new-commit-id] -- fileName  Git compares the difference between any two commits
Copy the code

View the commit record Git log

You can use the Git log command to view the history of your repository operations.

git log     # list all updates by time, most recent above, list sha-1 checksum name mailbox, commit time, description, show only current branch
git log -p -2   # is used to show the difference between each commit, and 2 indicates that only the last two commits are displayed.
git log -n2   Only the last two commits are displayed.
git log --stat      # With summary information, list the files that were modified each time
git log --pretty=oneline  # is displayed on the same line
git log --oneline # same line display
git log --all Display version history of all branches
git log --graph # Graphical display
git log branchName # to view a branch, this does not work if there is all

git log --pretty=format:"%h - %an, %ar : %s"
git log--since=2. Weeks // --author specifies the author --grep keyword in search commit description If you want to find commits that satisfy both search criteria, use --all-match -s to list commits that add or remove strings. For example the gitlog-Sfunction_name --path Specifies the git pathlog --pretty="%h - %s" --author=gitster --since="2008-10-01" \
   --before="2008-11-01" --no-merges -- t/

git log--oneline --decorate check the current object to which branches point to Gitlog --pretty=oneline [fileName]

git log --abbrev-commit   'Display shortest unique value'

git help --web log # View all through your browser

gitk  Open the graphical interface
Copy the code

File operations

Rename the file

Rename readme to readme.md

Method # 1
mv readme readme.md # direct rename
git add readme.md  Add the weighted named file
git rm readme  Delete the original file

# method 2 git command
git mv readme readme.md Git mv
Copy the code

Rename file

Git mv file_from file_to equals mv file_from file_to git rm file_from git add file_toCopy the code

Delete the file

Git rm file name. Delete files and commit them so that they are no longer traceable. Git file name = rm file name +git add. If it has been modified before deletion and put into temporary storage. -f is required to forcibly delete git rm -- the cached file name is removed from the staging area but remains in the workspaceCopy the code


Storage code

Git Stash is used when additional tasks are inserted after code changes are made to the workspace and repository and we need to temporarily store the contents of the existing workspace and repository

git stash

Git stash list git stash apply // The files that have been temporarily stored are not re-temporarily stored git stash apply --index Stash @{2} stash@{2} // drop stash stash pop // reapply and drop stash branch branchName // Create a new branch from the latest stash, // Git stash save noteContent But you can add the git stash clear // to clean up all the git stash show stash@{2} // to see how stash differs from the current oneCopy the code

Rollback and undo

Cancel the operation

Git reset HEAD <file>... // Cancel temporary storage. Git checkout -- <file>Copy the code

The staging area restores the state of the head pointer

Do not retain all the contents of the staging area and restore it to the same as head.

  • Start with the workspace content git Stash
  • Git reset HEAD restores the staging area to the workspace

Restores the staging area to the workspace

Cancel workspace change git checkout — fileName

Delete the most recent commit from the history commit

git reset --hard hash

Code back

  • Git reset HEAD file name, not all
  • Overwrite the old version of the staging area back:Git checkout -- file name
  • Back in the day:
    • Between Repository and Stage,commit reset
    • Between workspace Working and staging,add checkout
    • Git reset HEAD~ ~
    • Git rest –mixed(default) HEAD~
      • Move the HEAD pointer to point to the previous snapshot
      • Roll back the snapshot pointed to after HEAD is moved to the staging area
    • git rest –soft HEAD~
      • Move the HEAD point to the previous snapshot (undo a bad commit)
    • Git rest –hard HEAD~
      • Move the HEAD pointer to point to the previous snapshot
      • Roll back the snapshot pointed to after HEAD is moved to the staging area
      • Restore the files in the staging area to the working directory
    1. Move the HEAD point (–soft)
    2. Mix the snapshot into the staging area ([–mixed], default)
    3. Restore staging area to working directory (–hard)
    • Rollback specified snapshot, specify the first few :git reset ID
    • Roll back a file in a snapshot
      • Git reset Snapshot version file name/path
      • Git reset Specifies the snapshot version ID


Remote warehouse

Git remote add <shortname> < URL > git fetch [remote-name] When executed, you have references to all branches in the remote repository that you can merge and view at any time. Data is simply pulled to the local repository, not merged or modified. Git pull will automatically track the write permission of the remote repository that is cloned by the local master. Git remote rm repository name git remote rm repository name git remote rm repository name git remote rm repository name git remote rm repository name gitclone -b [branchName] [branchName]
Copy the code
  • Git push origin –delete branchName

Git pull and Git Fetch

The same place:

  • Git Fetch and Git pull are both ways to update code from a remote server

Different place

  • It is equivalent to obtaining the latest version from remote to local, and does not automatically merge
  • Git fetch + git merge

Git fetch & Git pull [Article from Shell Technology]

collaboration

Multiplayer collaboration, no forced submission, no base change.

Multiple users change the name of the same file

Git rm Source file name Git add Required file name Specifies the file name of git RM installments

Some people change the file name, others change the content of the file based on the original file name.

Git merges automatically. Git handles this very well, not necessarily with other version controls.

Use advanced

git chery-pick

Git cheese-pick copies a commit to the current branch. After cheese-pick, for historical purposes, Auther is the original commiter for the commit, but the commiter is itself. If you make changes to your code, you may need to change the auth to your own with a Git commit. For example, apply the BRANch1 commit1 commit to the Branch2 branch.

  1. Use git log to see the hash of the commit that needs to be applied to the new branch.
  2. Switch to the branch2git chery-pick [commit1hash]Can automatically submit

Chery -pick parameters:

  • Git cheese-pick-nAutomatic submission can be avoided.
  • Git cheese-pick-eYou can edit the COMMIT information.
  • Similar to Git Rebase, when you encounter a conflict,git cherry-pick --continue.git cherry-pick --abort.git cherry-pick --quit.

Apply the difference between commits to the new commit

Scenario: branchA and branchB differences applied to branchC implementation steps:

  1. ingit diffAfter the increase> patch
  2. Switch to the branchC
  3. git apply patch
  4. Notice The patch file will be generated in the current directory. You need to manually delete the patch file

Git hooks

Git hooks allow you to trigger scripts to perform certain Git operations, such as verifying that your commit message meets requirements, running unit tests in your code to ensure code quality before pushing it to a remote location, and so on.

Git ignores the commit hook

  • git commit --no-verifyThis allows us to commit without triggering the commit to be executed.

Verify the Commit message with git hooks

git reflog

Git reflog: git reflog: git reflog: Git reflog: Git reflog Git reflog: Git reflog: Git reflog: Git reflog: Git reflog: Git reflog Git logs are stored locally.

Git reset –hard HEAD^

Accidentally we have to code back to the last version, find the lost code. Implementation steps:

  1. Git reflog to find the commit hash that we accidentally deleted.
  2. Use cheese-pick to retrieve it

Lost code is recovered after a commit switch branch is performed in the separated header pointer state

Git reset –hard HEAD^

Change git commit history

Git Rebase makes it easy to make changes to your commit history. Making changes to the committed history can cause conflicts in the code that need to be resolved. Changing git commit history is a very dangerous operation. The changed branch cannot be directly pushed to the remote repository, so it must be pushed forcibly. If the branch involves **** multi-person collaboration, special attention should be paid to avoid unnecessary trouble.

Combine changes to different branches by rebasing

We have developed new features based on the Master branch. First, we cut off a new branch called Feature1 to develop new features. After a week, we completed the development. Within this week, other colleagues also carried out normal development and finished online, and joined the Master branch. At this point, we need to apply the master changes made by other colleagues to our Feature1 branch within a week. This can be achieved by merging branches and rebasing. By rebasing, our Git submission history will be aligned in a straight line. The obvious difference between this and merging branches is that merging branches mixes our multiple commits with the master’s change of commit within the week, depending on the time, whereas using base changes makes our commit order come after those commits on the master. Rebasing operations can cause conflicts.

#Using merge branches
git merge master

#Use rebase
git rebase master
Copy the code

Change the commit order

  1. git rebase -i [commit-hash]
  2. An edit window will appear, and we can save it by moving the order of coomit in the edit window.

Common vim shortcut keys: copy: YY, paste P, rollback U, save wq

Split commit with git rebase

Blog.csdn.net/weixin_3373… Implementation steps:

  1. git rebase -i [commit-hash]
  2. An editor window will appear in which all of our commits will appear. The status of the commit to be split will be changed to E to save the edited content.
  3. Git Rebse stays at the commit that needs to be split.
  4. Use git reset HEAD^ to undo the commit that needs to be split.
  5. Look at the current status, at which point we can add as many commits as we want.
  6. Git rebase –continue after we play commit. At this point we have successfully modified the commit record

2. Git tools

Select the Revised version

Branch reference

Git show [branchName] git show sha-1 git rev-parse [branchName]

Refer to the log

Git reflog looks at the reference log. Whenever a HEAD point changes, Git stores this information in the reference log. Git show HEAD@{5} git show master@{yesterday} see which commit this branch pointed to yesterday. Useful only for data that is still in the reference log. Git log -g displays reference log information similar to git log output format. Branch references only exist in the local repository, new clones reference log is empty

Ancestors reference

Use HEAD^ to view the last commit HEAD^2 D The second parent of the current commit HEAD~ points to the first parent commit HEAD~2 The first parent commit the two can be combined

Submit the interval

git logmaster.. Experiment looks at commits that exist in the Experiment branch but not in the Master branch. gitlogorigin/master.. HEAD views the content to be pushed to the remote end.Copy the code

Git defaults it to HEAD

multipoint

git logrefA.. refB gitlog ^refA refB
git log refB --not refA
Copy the code

Different from double dot syntax.

git log refA refB ^refC
git log refA refB --not refC
Copy the code

At three o ‘clock

Git log master… Git log –left-right master… experiment

Interactive temporary storage

Interactive staging, which groups specific parts of a file into commits, and makes changes to a set of files in the hope that the changes can be placed in several commits instead of being jumbled together. Git add -i git add –interactive In the command area, you can temporarily save files, cancel temporary files, temporarily save parts of files, add untracked files, and see differences in the contents of the staging area.

Temporary and untemporary files

3. Git basics

What is in Git

  • The HEAD file stores the current branch. Direct editing works just as well as switching branches
  • Config file storage, the config for this file
  • The refs folder heads branch tags store the hash value, and the hash value in tags refers to commit
  • The objects folder and the files in the folder form a hash value. Git cat-file is a tree. Git cat-file -p HSDH git cat-file -p HSDH git cat-file -p HSDH
git cat-file -t hash  The # command displays the content, type, and size of a repository object. I'll use -p for the content
Copy the code

Commit Tree blobs are three core objects. Any file that has the same file content is a unique BLOB

Commit Tree BLOb Three relationships



A commit corresponds to a tree, and the tree represents the view corresponding to the commit, which stores snapshots of all folders and files in the project repository corresponding to the current COMMIT. Blobs have nothing to do with file names.



For example:

Empty warehouse with doc/readme under it



Git add adds the file to the staging area, and Git will create a blob of the file under.git/objects. Such as the git/objects / 2 d / 832 d90044c. Git cat-file -t 2d832d90044c You can run git cat-file -t 2d832d90044c to check the blob file. You can run git cat-file -p t2d832d90044c to check the contents of the blob file



After the git commit, git will have 4 files in.git/ Objects.

  • One object: tree content is doc
  • One object: blob readme file contents
  • An object: the bloB of the readme file in tree
  • One object: commit

 

Detached HEAD

Changes are not made based on a branch, so a commit made on a split header pointer during a branch switch may be garbage removed by Git. If you consider the change important, be sure to tie the change to the branch. Git checkout [commitHash] is essentially working without a branch, so you can do development and commit. If you switch to a new branch, changes that are not associated with the branch may be garbage removed by Git. You want to make changes to the branch. Git checkout -b new-branch-name Git prompts you to build a branch for a commit that has already been committed. Git Branch can take advantage of this feature and, when discarded, simply switch to another branch.

Special identifier HEAD

Not only can the HEAD refer to the last commit of the new branch, but the HEAD can also be unlinked to the branch and in a separate head-pointer state (directed at a commit). If a branch is created/switched, the HEAD pointer points to the new branch. No matter what state the HEAD is in, the HEAD ends up at commit. HEAD can refer to commit. Git diff HEAD HEAD^ Compares this commit with its parent commit. HEAD^^ is the same as HEAD~2

A backup git

You can back up to another location on the local. Protocol and intelligent protocol intuitive difference: dumb protocol transmission progress must be seen; Intelligent protocol transport is visible. Transmission speed: Intelligent protocols transmit faster than dumb protocols. Git clone –bare file:///User//.git Git git push file:/// / user/ **/

Four, use the problem induction



Git add. Git commit -m"Comment"
git pull --rebase origin master
git push origin master
Copy the code

Git branch -a is also available locally after the remote branch is deleted

To solve the www.cnblogs.com/taohuaya/p/…

Git remote show origin git remote show origin Git remote prune origin [branch] git remote prune originCopy the code

Git ignores submitted files (.gitignore file is invalid)

Solve the link: www.jianshu.com/p/e5b134804… Plan a

Git rm [ignoreFileName] git commit-am [commit-message] # delete unwanted filesCopy the code

Add the ignore rule to the.gitignore file and submit the.gitignore file

git push [remote]
Copy the code

Scheme 2

Git rm -r -- git add. Git commit -m 'commit 'git pushCopy the code

For files that have been committed and changed (because rm’s files are in the cached list, that is, the modified list), it is best to create a.gitignore file at the same time as your Git repository

Merge Two unrelated branches

git merge -allow-unrelated-histories master orogin/master

Modify git commit author information

git commit --amend --reset-author

#Git rebase + commit --amend if you need to make changes more than once
Copy the code

Commit changes to some lines of the file to the staging area

This operation requires the patch parameter to git add

  1. Step 1: Run git add –patch to open a terminal interface
# Run this command directly
git add --patch

Or use this to open the interface and select Patch
git add -i
Copy the code
  1. Step 2: Select the required content. In the interactive interface, Git will list all our current changes one by one and provide commands for us to operate, roughly as follows
warning: LF will be replaced by CRLF in package-lock.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings inyour working directory diff --git a/666.js b/666.js index e69de29.. 8ea67d4 100644 -- a/666.js +++ b/666.js @@ -0,0 +1,65 @@ +console.log(1) +console.log(2) +console.log(3) Stage this hunk [y,n,q,a,d,e,?] ?Copy the code

The first current change is shown and several operations are provided for this change [y,n,q,a, D,e,?]. (The number of operations here is not certain, there may be other, this need not remember, directly enter to check the instructions, more familiar with)

Stage this hunk [y,n,q,a,d,j,J,k,K,g,/,s,e,?] ? y - stage this hunk n -do not stage this hunk
q - quit; do not stage this hunk or any of the remaining ones
a - stage this hunk and all later hunks in the file
d - do not stage this hunk or any of the later hunks in the file
g - select a hunk to go to
/ - search for a hunk matching the given regex
j - leave this hunk undecided, see next undecided hunk
J - leave this hunk undecided, see next hunk
k - leave this hunk undecided, see previous undecided hunk
K - leave this hunk undecided, see previous hunk
s - split the current hunk into smaller hunks
e - manually edit the current hunk
? - print help

Copy the code

We just type in a command for each change to the file, and we can decide whether or not to store that change in the staging area. Commands can be simply divided into two groups and two special ones.

Y - temporary storage of this block N - No temporary storage of this block Q - Exit; Do not temporarily store the remaining blocks including this block A - temporarily store this block and all blocks following this file D - do not temporarily store this block and all blocks following this file g - select and jump to a block / - search for blocks matching the given regular expression J - Temporarily undecided, Go to the next undecided block J - undecided, go to a block K - Undecided, go to the next undecided block K - undecided, go to the next undecided block S - Split the current block into smaller blocks e - Manually edit the current block? - Output helpCopy the code

Except for e, all the others are easy to understand. When we select E yes, we will enter a text editor interface, which is roughly as follows

# Manual hunk edit mode -- see bottom for a quick guide.@ @ - 0, 0 + 1,65 @ @ + console. The log (1) - the console. The log (2) + the console. The log (3)# -- -- --
# To remove '-' lines, make them ' ' lines (context).
# To remove '+' lines, delete them.
# Lines starting with # will be removed.
#
# If the patch applies cleanly, the edited hunk will immediately be
# marked for staging.
# If it does not apply cleanly, you will be given an opportunity to
# edit again. If all lines of the hunk are removed, then the edit is
# aborted and the hunk is left unchanged.
Copy the code
  • Rows deleted from changes are preceded by “-” criteria. If you don’t want to commit the change to staging, just change the “-” to “”.
  • Lines added to changes are preceded by a “+”. If you don’t want to commit the change to staging, just comment it out by adding a # before the “+”
  • Save the configuration and exit.

If there are multiple file changes in the current workspace, step 2 is repeated for each file until all files have been processed and exit automatically. You can use git diff –cached to see if your git add is correct. We can also directly use graphical software to operate, such as Sourcetree. Related links:

  • www.v2ex.com/t/322122
  • Use Git add-p to organize patch

Export git commit records to a file

# %h, abbreviated submit hash value
# %an, submitted by author
# % AD, date of submission
# %s, modify record
git log --date=iso --pretty=format:"%h"."%an"."%ad"."%s" >> history.csv
Copy the code

The local branch is associated with the remote branch

Remote branch association allows you to perform git push without explicitly specifying the remote branch. Application scenarios

  • Disassociate when you change the name of a local branch
  • To omit entering the remote branch before the new branch is pushed for the first time
#To view
git branch -vv

#Establishes the association between the current branch and the remote branch
git branch -u origin/master
#You can do that
git branch --set-upstream-to origin/master

#Disassociate the local branch from the remote branch
git branch --unset-upstream

Copy the code

Git advanced use

git subtree

6. Git related knowledge

Windows with git

  1. Try to use Gitbash for Git on Windows instead of using CMD, which has no command prompt and is not friendly when editing messages (such as commit messages).
  2. For our operations at gitbash, gitbash records command operations (last 500 commands) in the.bash_history file in the home directory of the currently logged user.
  3. The vim configuration file we used in gitbash is the.viminfo file in the home directory of the currently logged in user.
  4. If we use the user name and password to log in to GitHub/Gitee, we may fail to log in when we change the password or enter the wrong password for many times. In this case, we need to manually delete our login credentials. To do this, open the control panel \ User Account \ credentials manager, select Web credentials, and delete the GitHub tie we just entered.

Visualization Software Recommendation

tool

  • SQL Queries for Git Repositories – Query Git repository information by writing SQL

Git learning resources recommendation

  • Pro Git electronic edition
  • Practice web git command, the game is in the form of: https://learngitbranching.js.org
  • Git Flight Rules (Flight Rules) : https://github.com/k88hudson/git-flight-rules
  • Code cloud Git information (very recommended, especially comprehensive) : https://gitee.com/all-about-git
  • Geek Time’s play with Git Three Swordsmen, lecturing Su Ling (head of Ctrip code Platform)

article

  • “Memo” 60+Git common command lines
  • Three years of Experience with Git & FAQ sorting
  • This is the real Git — branch merge
  • Git new commands switch and restore