#4 使用 git-daemon
Git 开发工具 2017-03-15有时需要临时分享一个仓库给朋友,我们可以用 SSH 协议:
git clone ssh://markjour@192.168.64.234/home/markjour/Projects/Mine/lego
其实 git-daemon 是一个更好的方法。
coding in a complicated world
有时需要临时分享一个仓库给朋友,我们可以用 SSH 协议:
git clone ssh://markjour@192.168.64.234/home/markjour/Projects/Mine/lego
其实 git-daemon 是一个更好的方法。
$ git push origin v1.1.2 --delete
error: 目标引用规格 v1.1.2 匹配超过一个
error: 无法推送一些引用到 'gitee.com:markjour/markjour'
$ git push origin v1.1.2 --delete
error: dst refspec v1.1.2 matches more than one
error: failed to push some refs to 'gitee.com:markjour/markjour'
解决办法:
# 如果要删除的是分支
git push origin refs/heads/v1.0.32 --delete
To gitee.com:markjour/markjour
- [deleted] v1.0.32
# 如果要删除的是 Tag
git push origin refs/tags/v1.0.32 --delete
删除远程分支时报错:
git push --delete origin new
error: 无法删除 'new':远程引用不存在
error: 无法推送一些引用到 'gitee.com:markjour/django-admin'
如果是英文环境就是报:
git push --delete origin new
error: unable to delete 'new': remote ref does not exist
error: failed to push some refs to 'gitee.com:markjour/django-admin'
一般是这个分支已经被别人删除了。
git branch -d -r origin/new
Linus 为了托管内核代码的方便,创建了 Git。
之前,Linux 开发者使用的是 BitKeeper,不过社区对这个私有工具总是不放心,然后 BitKeeper 方面对于部分开发者试图逆向工程不满。
对于大多数公司来说, Git 的设计颇为复杂。
但是没办法,现在 Git 已经成为大多数开发者的选择。
git config 配置git init 初始化当前目录为 git 仓库git clone 克隆一个远程仓库到本地git add 添加变更(提交之前的挑选)git commit 提交变更git push 推送变更到远程仓库git pull 拉取远程仓库变更,并合并到本地;等于 git fetch + git mergegit status 查看变更状态git log 查看提交历史git branch 分支管理git checkout 切换分支git fetch 拉取远程仓库变更git merge 合并分支git config --global user.name "Your Name"
git config --global user.email "your@email.com"
git clone git@github.com:your-username/example
cd example
# 创建新文件
echo "hello" > newfile
git add newfile
git commit -m "Add newfile"
git push origin master