Git global setup
git config --global user.name "用户名" git config --global user.email "邮箱"Create a new repository
git clone http://ip:port/root/policy-web.git cd policy-web touch README.md git add README.md git commit -m "add README" git push -u origin masterExisting folder
cd existing_folder git init git remote add origin http://ip:port/root/policy-web.git git add . git commit -m "Initial commit" git push -u origin masterExisting Git repository
cd existing_repo git remote rename origin old-origin git remote add origin http://ip:port/root/policy-web.git git push -u origin --all git push -u origin --tags! [rejected] master -> master (fetch first) error: failed to push some refs to 'http://ip:port/root/policy-web.git'
出现这个问题是因为github中的README.md文件不在本地代码目录中,可以通过如下命令进行代码合并
git pull --rebase origin masterfatal: remote origin already exists.
1、先删除远程 Git 仓库然后再添加
git remote rm origin git remote add origin http://ip:port/root/policy-web.gitCloning into 'policy-web'... remote: HTTP Basic: Access denied fatal: Authentication failed for 'http://ip:port/root/policy-web.git/' 1、在git身份验证中输入的账号或者密码不正确。