Tag Archives: git

windows GitLab: PTY allocation request failed on channel 0

The company code is on GitLab, ready to upload a project code, operation reference:
https://blog.csdn.net/qq_20663229/article/details/80413188
When I submitted the code, I encountered some problems, and solved several problems through Baidu. Finally, I got stuck in two error reports like this:
fatal: Could not read from remote repository
PTY allocation request failed on channel 0
Process screenshot 1:

Process screenshot 2:

Solutions, reference:
https://stackoverflow.com/questions/13509293/git-fatal-could-not-read-from-remote-repository/56264790#56264790
I had this problem using gitbash on windows 10. I tried several things to solve this problem, the major ones being these:

    Recreated my SSH keys and updated to bitbucket. Didn’t helpTurned on debugging using this and found out that I was getting “shell request failed on channel 0” as asked hereRebooted my Windows PC

None of the above helped. I ended up re-installing Git for Windows This took only a few minutes compared to other things I did and it solved the problem!
According to the above steps, I reinstalled Git to solve the problem. When I installed Git, I chose OpenSSH. It is not clear whether it is related to this:

Fatal error: MSpanList_Insert error when installing golang source code

Golang was originally used in version 1.9, but today wants to upgrade to the latest version 1.11. Encountered the following error

failed MSpanList_Insert 0x905000 0x9b51f3c97b8 0x0 0x0
fatal error: MSpanList_Insert
runtime stack:
runtime.throw(0x5e5cf0, 0x10)
    /home/travis/.gimme/versions/go1.6.linux.amd64/src/runtime/panic.go:530 +0x90 fp=0x7fff5fbff0b0 sp=0x7fff5fbff098
runtime.(*mSpanList).insert(0x865d08, 0x905000)
    /home/travis/.gimme/versions/go1.6.linux.amd64/src/runtime/mheap.go:933 +0x293 fp=0x7fff5fbff0e0 sp=0x7fff5fbff0b0
runtime.(*mheap).freeSpanLocked(0x865500, 0x905000, 0x100, 0x0)
    /home/travis/.gimme/versions/go1.6.linux.amd64/src/runtime/mheap.go:809 +0x4be fp=0x7fff5fbff148 sp=0x7fff5fbff0e0
runtime.(*mheap).grow(0x865500, 0x8, 0x0)

The Internet did not find a good solution, finally put GOROOT_BOOTSTRAP go1.9 installation directory to solve. (The default GOROOT_BOOTSTRAP is pointing to go1.4)

cd ~/go/src
GOROOT_BOOTSTRAP='~/go1.9' ./all.bash

Solve github :error: failed to push some refs to problem


**
The error code is reported as follows
* *

To [email protected]:Fu4ng/Cpp.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:Fu4ng/Cpp.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

The solution
The problem arises because you do not have a READme.md file in your local library
The solution is also simple
enter git pull --rebase origin master
to pull down the MD file on github.
You can successfully upload your code by typing in the Git push-u Origin Master.

Pull the git warehouse code IDEA reports an error: Clone failed: Authentication failed for’http://10.xx.XXXXXXXXXXXXXXXXX’

Write custom directory titles here
The IDEA of an error: Clone failed: Authentication failed for ‘http://10.70.XXXXXXXXXXXXXXXXX’ git error: Please make sure you have the correct access rights and the repository exist. Step 1 check out project form version control. 2, enter. Git end of the clone address, test, and then clone. 3. It is worth mentioning that the second step before Test or clone needs to be logged in. (There’s a pit here.)
The solution is as simple as finding the Windows credentials manager and changing or deleting the username and password you saved before. Win + S input “credentials” will prompt “Credentials management”. Please make sure you have the correct access rights and the repository exist.

The IDEA of an error: Clone failed: Authentication failed for ‘http://10.70.XXXXXXXXXXXXXXXXX’
Make sure you have the correct access rights and the repository exist
Reference:
https://blog.csdn.net/m0_38022029/article/details/83374407
The first step on the job
The first thing I do when I enter a new company is to configure the development tools and pull down the code of the company’s current project from the company cloud. However, this first step will be a little painful. I will spend half the morning digging the hole.
steps
It’s usually pulled from Git. I used SVN before, but it’s very limited for Git, almost zero. Record the pull steps from your company’s Git repository.
1. Check out project Form version control.

will first say that for eclipse and Androidstudio, the workspace of eclipse is equivalent to the projects of Androidstudio, and the projects of eclipse are equivalent to the modules of Androidstudio.
and the reason why I say this is because when you pull a project, you have to pay attention to project management, directory management.
2, enter. Git end of the clone address, test, and then clone.
Without further ado, look at the picture.

3. It is worth mentioning that the second step before Test or clone needs to be logged in. (There’s a pit here.)
Pit here, prompt, enter the user name and password ‘popup window pop up only once, after the Windows are recorded in the local, to be exact records manager, the document of the Windows is the first time that I lose the wrong user name password, but still record and save the Windows, so after don’t pop up the user name password input box.
The solution is simple. Just go to the Windows credentials manager and change or delete the username and password you saved before. Win + S input “credentials” will prompt “Credentials management”.
Above the

Please make sure you have the correct access rights and the repository exist.
As for both Please make sure you have the correct access rights and the repository exist this error, is actually the remote warehouse are not logged in, without permission of course, the administrator has repeatedly confirmed give you permission, but git you are here to see this mistake, is actually you don’t have a successful login to the git remote warehouse, is in the git – bash on remote warehouse operation, of course.
I also searched a lot and typed a lot of commands in Git-bash, but none of them were caused by those problems. Here I also referred to other people’s posts, respected the originality, and marked the quotation at the beginning, which I also recorded and summarized myself, hoping that it could be helpful to others.
if comparison helps, please thumb up.

Git failed to submit data error: failed to push some refs to’https://github.com/XXXXXXX/gif.git’

Load code cloud use tutorial address: http://www.jianshu.com/p/084e0aabbab3
Problem a: execute the Git remote add origin https://github.com/XXXXXXX/gif.git
Fatal: Remote Origin Already exists.
When this problem occurs, Git Remote displays all the remote libraries and USES the command Git Remote RM Origin to delete the origin.

Issue 2: git push-u origin master pushes the local repository to github
fatal: I don’t handle protocol ‘git@https’
This problem, use the command git remote add origin http://github.com/XXXXXXX/gif.git.

question 3: perform $git push -u origin master
the Username for ‘https://github.com/XXXXXXX/gif.git’
! [rejected] master – & gt; Master (the fetch first)
error: failed to push some refs to ‘https://github.com/XXXXXXX/gif.git’
hint: Updates were rejected because the remote contains work that you do
hint: Not have mature. This is usually caused by another repository pushing
hint: To the same ref. You may want to first integrate the remote changes
hint: (e.g., ‘git pull… ‘) before pushing again.
hint: See the ‘Note about fast-forward ‘in ‘git push –help’ for details.
The main reason for the error is that there is already a README file on git repository, so there may be conflicts during submission. In this case, you need to choose to keep the online file or discard the online file. If you discard the online document, you need to choose to force push when pushing, which requires the following command

git push origin master -f

If you choose to keep the readME file online, you need to execute it first

git pull origin master

Git usage steps:

Build a new ABC warehouse on GitHub.
Create a Git repository locally:
1, the mkdir ABC
2, CD ABC
3, git init
4. Add file (file)
5, Git add file1 file2 file…
6. Git-commit-m “Add Files”
7, git remote add origin https://git.oschina.net/xxx/abc.git
8. Git push-U Origin Master
Here, an error message appears:
error: failed to push some refs to ‘https://git.oschina.net/xxx/abc.git’
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. ‘git pull’)
hint: before pushing again.
hint: See the ‘Note about fast-forwards’ in ‘git push –help’ for details.
The push failed because a READme.md file was initialized on GitHub. The files in the remote repository are newer than the local ones, so to use Git Pull you need to grab the latest file, merge it with the local file and commit it.
9, the git pull
Error:
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 3 (delta 0)
Unpacking objects: 100% (3/3), done.
From github.com:michaelliao/learngit
fc38031.. 291 bea8 dev – & gt; origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details
git pull < remote> < branch>
The reason is that there is no connection between the local master and the remote Origin /master.
10. Set up the connection
$ git branch –set-upstream master origin/master
11, the git pull
12. Then submit
git commit -m “merge README.MD”
13. Git push-U Origin Master completed local uploading to remote warehouse

How to solve error: failed to push some refs to ‘[email protected]:……git pull conflict

The reason for this conflict is that the branch of the remote warehouse has been modified, but you have not pulled it locally, and you have also made the changes locally, so the system does not know whether to focus on the remote warehouse or the local warehouse, so the conflict occurs.

so how to fix it?
Method one:
1. Git Stash saves local changes to the cache
2, the git pull
3. Git Stash Pop # merges local and remote changes
4. At this point, the conflict needs to be resolved manually, as shown below. Delete the marker line, and then determine which needs to be modified
5. Redo git add and git commit,git push

failed: Too many links (How to Fix)

Received feedback today that some files failed to synchronize. Looking at the logs found:

rsync: recv_generator: mkdir "/app/data/ckl/ckli2780581" failed: Too many links (31)
*** Skipping any contents from this failed directory ***
    enter the relevant directory to establish file:
cd /app/data/ckl/
mkdir vd

Report the same error:

failed: Too many links

2. Check the directory

ls /app/data/ckl | wc -l
31998

The sheer number of directories may be a limitation of the file system
3. Check the file system

 df -lhT
Filesystem                       Type  Size  Used Avail Use% Mounted on
/dev/sda1                        ext3  7.9G  4.9G  2.7G  65% /

It was ext3

is roughly as follows:

nclude/linux/ext2_fs.h:#define EXT2_LINK_MAX           32000
include/linux/ext3_fs.h:#define EXT3_LINK_MAX           32000

Why 31,998?This is because when mkdir creates a directory, two subdirectories are created by default, one is. The directory (representing the current directory), and the other one is.. Directory (representing the parent directory). These two subdirectories are not deleted, “rm.” will get “RM: cannot remove ‘.’ or ‘.. ‘”. So 32000-2 = 31998.
Solution:
Ext4 has no limit on the number of directories
Mount a new disk to establish a connection to the directory
The script is as follows:

#!/bin/bash
CUR_DAY=`date +%Y%m%d`
SRC_DIR=/app
DST_DIR=/data

fdisk /dev/vdc <<EOF
	d               
	n             
	p               
	1  
	1              
               
	t              
	83             
	w  
EOF  

echo
echo "star create vg and lv..."
pvcreate /dev/sdc1
if [ $? -eq 0 ];then
	vgcreate data-volume /dev/vdc1
	if [ $? -eq 0 ];then
		lvcreate -L 99G -n s1_data data-volume
	else
		echo "lv create failed!"
		exit 1
else
	echo "vg create failed !"
fi
mkfs -t ext4 /dev/data-volume/s1_data

mount /dev/data-volume/s1_data ${DST_DIR}
cp -a ${SRC_DIR}/data ${DST_DIR}
mv ${SRC_DIR}/data ${SRC_DIR}/data_bak/
ln -s ${DST_DIR}/data/ ${SRC_DIR}/data

git clone Error “Clone failed: Authentication failed for xxxxx”

When I clone the clone warehouse project from the company, I kept receiving this error.
Possible scenarios include:
1. There is no project operation permission in the warehouse, so I need to contact master or master programmer to pull you into the project and authorize
2. Open “Git bash”; Add user.name and user.email; The identity authentication

And you can view it through Git Config — List
3. If clone or push had been normal all the time; Suddenly failed; Think about whether you’ve ever changed your Git password. If it has been modified, this error is sure to occur
The solution is to open Windows’ credential manager; It will automatically record your Git address, username, password, etc. Change the password inside

Miscellaneous Notes (2)

Hide the scroll bar and keep the scroll effect


.outer-container {
    overflow: hidden;        // 隐藏滚动条
    width: 240px;          // 内容宽度,同时配合子元素
    height: 100%;
  }
  .inner-container {
    overflow-x: hidden; // 隐藏水平滚动条
    overflow-y: scroll;    // 产生垂直滚动
    width: 257px;       // 比父元素宽出滚动条的宽度 17px
    height: 100%;          // 设置产生滚动条
  }
  .inner-container::-webkit-scrollbar {
    display: none;            //  webkit 内核的浏览器仅需设置此属性
  }

// 另一种方法,在滚动的容器设置
.inner-container {
    margin-right: -17px;
}

错误:pathspec的字段与git已知的任何文件不匹配。

// 需要在提交时将描述信息放在两重引号中,原因疑是 git 无法识别 文件名或路径
git add .
git commit -m "'your message'"
git pull origin master
git push origin master

Check whether to jump after logging in to prevent an endless loop


router.beforeEach((to, from, next) => {
    out //判断登录状态简单实例
    var userInfo = window.localStorage.getItem('token');
    if (userInfo) {
        next();
    } else {
        next('/login');
    }
})

// 以上会发现出现如下错误:出现 dead loop错误,解决方法如下所示
// 解决思路:排除此时地址 = 转向的地址 的情况,避免dead loop
router.beforeEach((to, from, next) => {
    var userInfo = window.localStorage.getItem('token');//获取浏览器缓存的用户信息
    if(userInfo){ //如果有就直接到首页咯
        next();
    } else {
        if(to.path=='/login'){ //如果是登录页面路径,就直接next()
            next();
        } else { //不然就跳转到登录;
            next('/login');
        }

    }
})

BrowserslistError: Unknown browser major
Bootstrap.min. js normal bootstrap.min. CSS error reporting


ERROR in ./node_modules/css-loader?minimize!./node_modules/autoprefixer-loader!./node_modules/bootstrap/dist/css/bootstrap.min.css
    Module build failed: BrowserslistError: Unknown browser major
        at error (E:\project\node_modules\browserslist\index.js:37:11)
        at Function.browserslist.checkName (E:\project\node_modules\browserslist\index.js:320:18)
        at Function.select (E:\project\node_modules\browserslist\index.js:438:37)
        at E:\project\node_modules\browserslist\index.js:207:41
        at Array.forEach (<anonymous>)
        at browserslist (E:\project\node_modules\browserslist\index.js:196:13)
        at Browsers.parse (E:\project\node_modules\autoprefixer\lib\browsers.js:44:14)
        at new Browsers (E:\project\node_modules\autoprefixer\lib\browsers.js:39:28)
        at loadPrefixes (E:\project\node_modules\autoprefixer\lib\autoprefixer.js:56:18)
        at plugin (E:\project\node_modules\autoprefixer\lib\autoprefixer.js:62:18)
        at LazyResult.run (E:\project\node_modules\postcss\lib\lazy-result.js:274:20)
        at LazyResult.sync (E:\project\node_modules\postcss\lib\lazy-result.js:261:32)
        at LazyResult.stringify (E:\project\node_modules\postcss\lib\lazy-result.js:285:14)
        at LazyResult.get (E:\project\node_modules\postcss\lib\lazy-result.js:334:25)
        at Object.module.exports (E:\project\node_modules\autoprefixer-loader\index.js:55:35)

Solutions:

// Edit node_modules\bootstrap\package.json: Remove these lines:

"last 1 major version",
">= 1%",

Use the font – awesome webpack – vue
NPM installs font-awesome and any dependencies it requires


npm install less less-loader css-loader style-loader file-loader font-awesome --save

Globally register font-awesome in the entry file


import 'font-awesome/css/font-awesome.min.css';

Configure the parsing


{
    test: /\.(gif|jpg|jpeg|png|woff|svg|eot|ttf)\??.*$/,
    loader: 'url-loader?limit=1024'
},

Iview navigation component: after the current page is selected, click refresh or click the browser back button, the selected navigation bar disappears


在vuex的 state 存储 active-name,根据路由用 computed 取出 active-name

Reproduced in: https://www.cnblogs.com/anani/p/9643819.html

[Git & GitHub] Solution: error: failed to push some refs to’https://github.com/xxxx.git’

Problem description: after creating the repository remotely on github, the following error occurs while submitting a local file using gitbash
$ git push -u origin master
fatal: HttpRequestException encountered.
An error occurred while sending the request.
Username for ‘https://github.com’: bluetata
To https://github.com/bluetata/Javascript-AngularJS.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to ‘https://github.com/bluetata/Javascript-AngularJS.git’
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: ‘git pull … ‘) before pushing again.
hint: See the ‘Note about fast-forwards’ in ‘git push –help’ for details.
Problem analysis: I created the empty repository on Github first, checked the create READme.md file, but did not pull it locally when Using Gitbash. Then use gitbash to submit the local file to the warehouse, an error occurred while pushing.
Solution: error message can be seen in the local and remote matching is not complete, also found on the Internet, summed up for the local warehouse and remote warehouse conflict caused by.
The following solutions are summarized:
1: Pull the remote warehouse to the local warehouse before push
$git pull origin master #git pull –rebase origin master
$git push-u origin master
2: force push local warehouse to remote (this case does not merge, remote files may be lost after force push is not recommended)
$ git push -u origin master -f
3: to avoid conflict resolution, temporarily submit the local file to the remote branch
$git branch [name]
# after creating the branch, then push
$git push-u origin [name]
Note: This article was originally published in ‘bluetata’ on blog.csdn.net.

! [rejected]master -> master error: failed to push some refs to’https://github.com/ The ultimate solution

Git error:

$ git push -u origin master

To [email protected]:***.git

 ! [rejected]        master -> master (non-fast-forward)

error: failed to push some refs to '[email protected]:***.git

hint: Updates were rejected because the tip of your current branch is behin

hint: its remote counterpart. Integrate the remote changes (e.g.

hint: 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Git already has some code in the repository, so it doesn’t allow you to overwrite your code directly. There are two ways to solve this problem:
method 1: force the code to github warehouse (recommended, save time and effort)

git push -f origin master		//直接强推,即利用强覆盖方式用你本地的代码替代github仓库内的内容

method 2: fetch git’s stuff to your local, merge and push

git fetch
git merge			//这两条命令等价于git pull  
git config branch.master.remote origin  
git config branch.master.merge refs/heads/master  

Then pull git back and git pushes your code. Reference: Here.