Some Git Tips

作者: Ekolia | 来源:发表于2019-03-04 00:14 被阅读10次

本地局域网共享git版本

可以通过ssh来访问同局域网

git clone ssh://username@hostname/~/PathToProject/.git

ps: Mac需要开启远程登录许可


remote login

ps: Mac 可以通过airdrop来直接传输所有应用,包括项目。

传输项目是会应用gitignore文件,这个不知道算好处还是坏处(实在有需要时,可以用zip)。

git stash

之前公司有个帅哥经常问我有没有听说过git stash,一直不屑一顾,其实对效率挺有帮助的的。

// 假设有一天你在buging。
// 写到一半产品忽然来找你提一个紧急小pr,你代码没写完不想commit
// 这时你可以
git stash && git checkout master
// 做完需求之后可以
git checkout the_branch && git stash pop

简单对比

git status
// 纵览修改,变更情况
git diff origin/master --raw
git diff origin/master test.py

查询revert前的commit

git log // 木有
git reflog // 可以查到记录和id

修改gitignore

git rm -r --cached .
git add .
git commit -m 'words'

相关文章

  • Some Git Tips

    本地局域网共享git版本 可以通过ssh来访问同局域网 ps: Mac需要开启远程登录许可 ps: Mac 可以通...

  • 商务英语 Level4 Unit2 part2

    Interview Tips Here are some tips for how to conduct a pr...

  • some tips

    公司小哥准备要跟着我这组学习ruby,然后写了些小建议: 1. 锻炼身体,推荐keep或跑步 2. 至少每周三次,...

  • some tips

    1.土豆削皮后有大量的淀粉在表面(貌似刀切比用筛子处理的会好一些),在炒之前最好是用清水清洗一下。但是不用清洗太彻...

  • Some Tips

    1、访问私有属性 2、访问 bundle 中的 json 文件 3、隐藏导航栏返回标题 4、weak self 5...

  • Some Tips

    1、在项目编译过程中gradle.properties配置的值会被编译解析,其作为配置文件使用是很有必要的当在gr...

  • Some tips

    1. CPU 32位机型 armv6, armv7, armv7sCPU 64位机型 arm64模拟器32位处理...

  • some tips

    开始学着使用onenote,发现可以把会议的内容很好的记录在里面。对一些幻灯内容进行拍照,可以打字把思考的部分写在...

  • Sth about Python 03---This is a

    ''' In this small progrom there are some tips as follows....

  • Welcome to Xpad, my friend!

    Below some hints and tips of the less obvious to get the ...

网友评论

    本文标题:Some Git Tips

    本文链接:https://www.haomeiwen.com/subject/qxbvuqtx.html