添加和提交文件后,Git push不起作用

时间:2019-05-24 03:26:44

标签: git

我是Github和Git的新手,尝试在Windows上使用gitbash。添加并提交文件后,如果我添加git push cmd。.cli要求输入用户名...然后输入一个密码,该密码无界面输入密码。我该怎么办? enter image description here

2 个答案:

答案 0 :(得分:1)

检查git config credential.helper的值:如果它是“ manager”,则打开Windows Credential Manager并查看是否已经有github.com条目。

如果没有,并且问题仍然存在,请从常规CMD(而非git bash)和以下简化的PATH尝试相同的命令:

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%

(用Git安装文件夹替换“ path\to\git”)

答案 1 :(得分:1)

在git bash中,您最好运行以下命令:

git config --global credential.helper wincred

到那时,运行git pull之类的命令并输入一次凭证,应该将其存储起来以备将来使用。 Git有一个内置的凭据系统,可以在不同的OS环境中工作。

您可以在git网站Git Tools - Credential Storage上获得更多详细信息。

如果git pull之前已移至远程服务器,则应在git push之前使用exec java -Dspring.profiles.active=docker -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:+ExitOnOutOfMemoryError -cp . -jar /deployments/app.jar . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.0.1.RELEASE) 2019-05-23 00:34:21.142 INFO 1 --- [ main] com.auth.wisat.WisatApplication : Starting WisatApplication v0.1.5 on api-8554d5fd4c-wqrpb with PID 1 (/deployments/app.jar started by root in /deployments) 2019-05-23 00:34:21.144 INFO 1 --- [ main] com.auth.wisat.WisatApplication : The following profiles are active: docker 2019-05-23 00:34:21.185 INFO 1 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@44e81672: startup date [Thu May 23 00:34:21 GMT 2019]; root of context hierarchy 2019-05-23 00:34:23.024 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$ca1676b3] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-05-23 00:34:23.189 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration' of type [org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration$$EnhancerBySpringCGLIB$$62c43eed] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-05-23 00:34:23.196 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'objectPostProcessor' of type [org.springframework.security.config.annotation.configuration.AutowireBeanFactoryObjectPostProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-05-23 00:34:23.198 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@173ed316' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-05-23 00:34:23.201 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration' of type [org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration$$EnhancerBySpringCGLIB$$8798e19f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-05-23 00:34:23.209 INFO 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-05-23 00:34:23.457 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2019-05-23 00:34:23.483 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-05-23 00:34:23.483 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.29 2019-05-23 00:34:23.492 INFO 1 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64:/usr/lib/jvm/java-1.8-openjdk/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib] 2019-05-23 00:34:23.647 INFO 1 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2019-05-23 00:34:23.647 INFO 1 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2464 ms 2019-05-23 00:34:24.528 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*] 2019-05-23 00:34:24.528 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 2019-05-23 00:34:24.529 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*] 2019-05-23 00:34:24.529 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*] 2019-05-23 00:34:24.529 INFO 1 --- [ost-startStop-1] .s.DelegatingFilterProxyRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*] 2019-05-23 00:34:24.529 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpTraceFilter' to: [/*] 2019-05-23 00:34:24.529 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'webMvcMetricsFilter' to: [/*] 2019-05-23 00:34:24.529 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'authenticationTokenFilter' to: [/*] 2019-05-23 00:34:24.529 INFO 1 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/] 2019-05-23 00:34:24.619 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...

希望它能起作用!