git使用指南

There have been so many debates on whether a designer should learn how to code — this is not one of them. However, there are many times within a team, that a designer may be required to provide developers assets they need or maybe even write a snippet of CSS. As digital teams get more diverse and roles overlap, working collaboratively becomes essential.

Ť这里已经对一个设计师是否应该学习如何代码这么多的争论-这是不是其中之一。 但是,在团队中很多时候,可能会要求设计师为开发人员提供他们所需的资产,甚至可能编写一段CSS。 随着数字团队的多样化和角色重叠,协作变得至关重要。

One tool that makes this collaborative experience run smoothly is git. Learning how to use git can be a distinctive skill that will improve your effectiveness and relationship with the developers on your team. And you don’t even need to know everything about git to get to this level of efficiency.

git是使这种协作体验平稳运行的一种工具。 学习如何使用git是一项独特的技能,可以提高您的效率以及与团队中开发人员的关系。 而且,您甚至不需要了解有关git的所有知识即可达到此效率水平。

等等,git? (Wait, git?)

Git is a version control system that keeps track of all the changes you or your teammates make to the code repository. It helps you write code safely knowing you can keep track of changes and even undo them in the event of a code mishap. Imagine if you didn’t have Ctrl-Z, how horrible would writing a text file be?

Git是一个版本控制系统,可跟踪您或您的队友对代码存储库所做的所有更改。 它可以帮助您安全地编写代码,因为您知道自己可以跟踪更改,甚至在发生代码故障时可以撤消更改。 想象一下,如果没有Ctrl-Z,编写文本文件将有多可怕?

But unlike most text document management tools, Git keeps track of all your code writing timeline as long as you commit. If there’s any takeaway you get from this article let it be this — Remember to always commit your changes.

但是与大多数文本文档管理工具不同,只要您提交,Git就会跟踪您所有的代码编写时间轴。 如果您从本文中获得任何收获,那就这样吧- 请记住始终提交更改。

But let’s see what a likely scenario where a designer may get to use git is.

但是,让我们看看设计师可能会使用git的情况。

可能的情况 (A likely scenario)

Imagine there’s a part of your company’s web app you’ve recently redesigned to improve usability. It’s an important change, something that will save the customer support folks a few calls, but the developers are busy with the sprint and can’t spare the time.

想象一下,您公司的网络应用程序中有一部分是您最近重新设计的,以提高可用性。 这是一项重要的更改,可以为客户支持人员节省一些电话,但是开发人员忙于冲刺,无法节省时间。

You, on the other hand, can manage the change since you are a CSS guru and a designer who knows the implication if the change doesn’t go out with the next release. You get a go-ahead from the product and engineering managers, who say ‘go make the change!’ How do you make these changes and work collaboratively with your teammates without messing things up for anyone involved?

另一方面,您可以管理更改,因为您是CSS专家,并且是设计师,如果更改不能在下一个版本中发布,他就会知道其中的含义。 您会得到产品和工程经理的认可,他们说“去做改变!” 您如何进行这些更改并与您的队友协同工作,而又不弄乱所涉及的任何人?

Here’s how:

这是如何做:

Note: For the purpose of this article, I have created a GitHub repository that you can use in following along with this article. So, imagine this is your team’s repository: https://github.com/busayyyo/designers-guide-to-git

注意:出于本文的目的,我创建了一个GitHub存储库,您可以在本文后面使用它。 因此,想象一下这是您团队的存储库: https : //github.com/busayyyo/designers-guide-to-git

1. Clone repository: The first thing you wanna do is clone your team’s remote repository. It will be on a code repository management software such as GitHub, Bitbucket or Gitlab. Cloning allows you to create a copy of the repository into your local machine. You clone using this command: git clone <remote repository address>

1.克隆存储库:您想要做的第一件事就是克隆团队的远程存储库。 它将在代码存储库管理软件上,例如GitHub,Bitbucket或Gitlab。 克隆使您可以将存储库的副本创建到本地计算机中。 您可以使用以下命令进行git clone <remote repository address>git clone <remote repository address>

In our hypothetical case: git clone https://github.com/busayyyo/designers-guide-to-git

在我们的假设情况下: git clone https://github.com/busayyyo/designers-guide-to-git

2. Check and maybe switch branch: Now that you have the cloned files locally, the next step is to check where you are. Think of branches as rooms in your communal living repository house. You want to be in the right room before you decide to paint a wall red.

2.检查并可能切换分支:现在您已经在本地拥有了克隆的文件,下一步就是检查您的位置。 将分支视为您的公共生活仓库中的房间。 在决定将墙壁漆成红色之前,您要先在正确的房间里。

To do this, first go into the house, i.e the directory where your cloned repository now is. You do this using the cd <directory-name> command, in our case: cd designers-guide-to-git

为此,首先进入内部,即克隆的存储库现在所在的目录。 您可以使用cd <directory-name>命令执行此操作,在本例中为: cd designers-guide-to-git

Then use the command git branch

然后使用命令git branch

git branch — this shows you the current repository, i.e the room where you are right now

git branch —向您显示当前存储库,即您现在所在的房间

Let’s say you find yourself on the master branch… that’s a room you don’t wanna be in while you paint the town red. Get out of there and go to the branch your teammates develop on. We’ll call that ‘develop’.

假设您发现自己在主分支上……那是您在将城镇涂成红色时不想进入的房间。 离开那里,前往与队友一起发展的分支。 我们称其为“ 开发 ”。

git checkout develop — switches you to the right branch, aka your team’s development room.

git checkout develop —将您切换到正确的分支,即您团队的开发室。

3. Pull: Between cloning, branch switches and the bathroom break you just had, your teammates may have pushed new changes to the develop branch you are on. You want those changes in your local version as well and it’s good practice to always pull them in every chance you get. To do that, all you have to do is:

3.拉:在克隆,分支切换和您刚洗完澡间休息之间,您的队友可能已将新更改推送到您所在的开发分支上。 您还希望在本地版本中进行这些更改,因此,最好始终抓住所有可能的机会进行更改。 为此,您要做的就是:

git pull origin develop

git pull origin develop

4. Branch: Now that you have the latest changes in the develop branch, you wanna get cracking, yeah? Well, not so fast. Remember, the develop branch is the communal room what everyone on your team pushes to before going live. It may not be the master branch but it is still sacrosanct and you don’t wanna mess it up. You want to create your own branch. Think of it like creating your own playground, where if you mess up, it’s only your own mess and you have all the time in the world to clean it up. Branching is essential to working collaboratively with git. To create your own branch, use the command: git branch <branch-name>, in our case:

4.分支:既然您在develop分支中拥有最新的更改,那么您想破解吗? 好吧,不是那么快。 请记住,develop分支是公用空间,您团队中的每个人在上线之前都会推送到该公用空间。 它可能不是主分支,但它仍然是神圣不可侵犯的,您不想将其弄乱。 您要创建自己的分支。 可以将其想像成创建自己的游乐场,如果您搞砸了,那只会是您自己的一团糟,世界上所有的时间都需要清理它。 分支对于与git协作至关重要。 要创建自己的分支,请在以下情况下使用命令: git branch <branch-name>

git branch playground

git branch playground

Next thing to do is go into your playground that you just created using the command git checkout <branch-name> as in: git checkout playground

接下来要做的是进入您使用命令git checkout <branch-name>创建的操场,如下所示: git checkout playground

This new branch is a copy of the ‘develop’ branch, the difference is, you can paint this playground red if you wish.

这个新分支是'develop'分支的副本,不同之处在于,可以根据需要将此操场涂成红色。

Tip: You could create a new branch and checkout into it with a single command: git checkout -b <branch-name>

提示: 您可以创建一个新分支,并使用单个命令将其 git checkout -b <branch-name> git checkout -b <branch-name>

5. Status: You can check the status of your branch by typing git status. Status shows you the files that have been changed but not yet committed.

5.状态:您可以通过输入git status来检查分支的状态。 状态显示已更改但尚未提交的文件。

git status

git status

Since we haven't made any concrete changes to the file just yet, you won’t get much feedback regarding your files. This is time to give git a break, go into the CSS file you wanna make changes to and do your CSS magic. To test now, you can create an empty file — say test.html

由于我们尚未对文件进行任何具体更改,因此您不会收到有关文件的大量反馈。 现在是时候让git休息一下,进入您想要更改CSS文件,然后做一下CSS魔术。 要立即进行测试,您可以创建一个空文件-例如test.html

6. Add: After creating a file or making changes to a file, you should add it. Adding makes the git begin to track the changes you make to that file. You can add all changes git add <filename> or git add .

6.添加:创建文件或对文件进行更改后,应添加它。 添加使git开始跟踪您对该文件所做的更改。 您可以添加所有更改git add <filename> or git add .

A little side note, the . after the add command stands for the directory. So in essence, you are saying add all the changes in this directory.

一点说明,。 在添加命令代表目录之后。 因此,实质上,您是说在此目录中添加所有更改。

7. Commit: Committing is very important. Committing is creating a record of the changes you have just added. You get a short SHA code after commit. This code can be used to roll back changes just in case you decide that was the wrong change or you roll back to a previous version. It is essential to add a commit message — which is a short description of the change you just made.

7.提交:提交非常重要。 提交正在创建您刚刚添加的更改的记录。 提交后,您会得到简短的SHA代码。 此代码可用于回滚更改,以防万一您确定错误的更改或回滚到先前版本。 添加提交消息非常重要-这是您刚刚进行的更改的简短描述。

git commit -m "changes button color to red"

git commit -m "changes button color to red"

8. Log: Git log shows you the history of all commits in the repository. Every now and then, you may want to see your commits log or the commits your teammates have made. To do that it’s as simple as typing: git log

8.日志: Git日志向您显示存储库中所有提交的历史记录。 时不时地,您可能希望查看自己的提交日志或队友所做的提交。 为此,就像输入一样简单: git log

9. Push: Say you’ve made all the usability changes you want to and you’ve added and committed them intermittently and the log says so. Now is the time to push. Pushing registers your changes on the remote repository where other members of your team can access.

9.推送:假设您已经进行了所有想要的可用性更改,并且已间歇性地添加并提交了这些更改,并且日志显示了这一点。 现在是时候了。 推送将您的更改注册到团队其他成员可以访问的远程存储库中。

git push origin playground

git push origin playground

Now your branch is saved in the remote repository.

现在,您的分支已保存在远程存储库中。

10. Merge: Merging is an attempt to include your branch changes to the rest of the team’s. It’s like asking your room to be part of the team’s house. Typically, in a team setting, you would make a merge request on Github or the equivalent that your company uses. A merge request is you asking that your playground branch be included as part of the ‘develop’ branch which is the team’s house.

10.合并:合并是为了将您的分支更改包括到团队的其余部分中。 这就像要求您的房间成为团队成员的一部分。 通常,在团队环境中,您将在Github或贵公司使用的同等产品上提出合并请求。 合并请求是您要求将操场分支包括在团队房屋的“开发”分支中。

However, in the extremely unlikely case where you have to handle this yourself, all it involves is going into the team’s working branch i.e develop and then merge yours, using these two commands:

但是,在极不可能的情况下,您必须亲自处理此问题,它涉及的只是进入团队的工作分支,即使用以下两个命令来开发然后合并您的分支:

git checkout develop

git checkout develop

git merge playground

git merge playground

This is by no means the end to git. But this is likely to be your most typical workflow when working with git as a designer. Understanding these 10 commands will help you work effectively with git. But just in case it all seems so tedious with the command line interface, you can also use apps such as the GitHub desktop app if your team’s repository is hosted on Github. All the best with git!

这绝不是git的结局。 但这可能是与git作为设计师一起使用时最典型的工作流程。 了解这10个命令将帮助您有效地使用git。 但是,以防万一,使用命令行界面显得如此乏味,如果团队的存储库托管在Github上,您还可以使用GitHub桌面应用程序之类的应用程序 。 git一切顺利!

翻译自: https://uxdesign.cc/a-designers-guide-to-git-4dab3a57b802

git使用指南


http://www.taodudu.cc/news/show-4625507.html

相关文章:

  • java写作教程_如何编写技术教程-发布关于开发人员写作的新书
  • 政客常用手段_我可以比政客更好地管理经济
  • 老码农回答为什么会有“在X有Y年的工作经验“这样的要求
  • 720度全景带你vr云游景区,vr云游在景区的应用优势
  • 阿里云块存储企业级特性之异步复制
  • 云手机服务器解决方案
  • 腾讯云数据库产品介绍第四章-
  • 关于720全景视频在移动端播放的兼容问题汇总,截止2017年11月29日
  • 阿里云标准型s6实例规格性能及应用场景
  • 微擎安装之腾讯云懒人教程篇
  • 阿里云oss(图片存储)--fastdfs (视频存储)
  • python tkinter出牌洗牌
  • 华为机试:连续出牌数量
  • 出牌,用程序判断手中的牌是否能够压过对方出牌
  • cocos2dx《单机斗地主》源码解剖之八 电脑玩家出牌与跟牌(结束)
  • unity开发 斗地主算法—提示AI(提示出牌)
  • 斗地主中自主出牌的游戏逻辑
  • 跑得快—扑克牌游戏出牌规则(JavaScript)
  • 斗地主老是输?Python教你做个自动出牌器,欢乐豆蹭蹭涨
  • 纸牌游戏的牌型分析和出牌策略
  • 【华为OD机试真题 JAVA】连续出牌数量
  • 斗地主之出牌
  • 麻将客户端出牌动作
  • DFS+DP搜索斗地主玩家手牌最少出牌次数
  • 斗地主滑动选牌出牌(Cocos Creator)
  • 算法题:最少出牌次数
  • 斗地主老是输?一起用Python做个自动出牌器,欢乐豆蹭蹭涨!
  • 斗地主陪练机器人出牌算法使用说明
  • 笨蛋!连0.2这么简单的数字都搞不定!你被炒了!
  • 不定积分较难题

git使用指南_git设计师指南相关推荐

  1. .git文件夹_Git幸存者指南

    > Learn how to use Git to version control a cake recipe- and other things like code! 或如何用Git烤蛋糕 G ...

  2. diff git 代码实现_Git 自救指南:这些坑你都跳得出吗?

    每天都会写架构师文章,Java技术文章天天更新,感兴趣的点个关注再走呗! Git 虽然因其分布式管理方式,不完全依赖网络,良好的分支策略,容易部署等优点,已经成为最受欢迎的源代码管理方式. 但是一分耕 ...

  3. diff git 指定时间_Git 自救指南

    Git 虽然因其分布式管理方式,不完全依赖网络,良好的分支策略,容易部署等优点,已经成为最受欢迎的源代码管理方式.但是一分耕耘一分收获,如果想更好地掌握 git,需要付出大量的学习成本.即使在各种 G ...

  4. git学习指南_GIT 学习指南

    创建一个版本库非常简单,首先,选择一个合适的地方,创建一个空目录: $ mkdir learngit $ cd learngit $ pwd /Users/michael/learngit pwd命令 ...

  5. 图解git原理与日常实用指南

    缘起 读了"扔物线"老师的小册<Git 原理详解及实用指南>感觉收获良多,于是想写点东西做一个总结,即加深自己的印象也希望能给社区小伙伴一点帮助,写的不对的地方还请多多 ...

  6. Git和Github介绍,294页『Git与Github学习使用指南』分享

    1 前言 相信大家写代码的时候,心里肯定想找一个别人写好的,可以直接上手的代码,再做相应的修改和改进.那哪里有这些代码呢? 答案自然是Github了,那GitHub又是啥? GitHub是世界上最大的 ...

  7. 安全牛:“新一代SOC研究报告”之市场指南及技术指南点评

    在2017年8月9日,国内知名的企业级信息安全市场的专业新媒体--安全牛--发布了"新一代SOC研究报告"之市场指南及技术指南.在指南正式发布之前,7月份的阿里安全峰会(以后改成& ...

  8. python编程入门指南-编程入门指南

    编程入门指南 ----------------------------------------------- 编程入门指南 v1.5 --- https://zhuanlan.zhihu.com/p/ ...

  9. keras安装与配置指南_Keras-快速指南

    keras安装与配置指南 Keras-快速指南 (Keras - Quick Guide) Keras-简介 (Keras - Introduction ) Deep learning is one ...

最新文章

  1. Unit05: 创建和访问数组 、 数组的常用方法_1
  2. java中json重复数据结构_JS实现去除数组中重复json的方法示例
  3. 栈的动态顺序存储和实现(C语言)【栈】(7)
  4. S2SH框架入门之使用hibernate进行基础的增删改查
  5. 为什么要叫长虹玻璃呢_中和热测定实验中为什么温度计要放到环形玻璃棒中间?放外面可行吗?...
  6. 在线编辑_水墨-在线 Markdown 编辑器
  7. 数据库索引优化原理,索引的工作机制
  8. hikaridatasource连接池_完美!细数SpringBoot中的那些“连接池”
  9. 不会编程,如何做自动化测试
  10. 下面以Button组件为例,开始FLEX皮肤制作的入门。
  11. VS编译器的使用——VS2019新建控制台工程
  12. m7405d粉盒清零方法_联想各种打印机多功能一体机硒鼓清零方法汇总
  13. 【论文学习笔记-9】ACFNet:Adaptive Unimodal Cost Volume Filtering for Deep Stereo Matching(2020AAAI)
  14. 如何通过知识付费盈利,实现内容变现?
  15. 学术规范作业——心得体会
  16. [1191]电脑耳机孔插上耳机没反应
  17. CSS3 画皮卡丘
  18. H5 嵌入条码和二维码生成
  19. 李宏毅学习笔记35.GAN.06.Tips for Improving GAN
  20. Host文件的使用与说明

热门文章

  1. PDF如何裁剪页面并保持页面大小不变
  2. 关于有氧运动的误区 你知道几个
  3. 4g华为可以安装鸿蒙吗,华为新机入网,预装鸿蒙,但是只支持4g
  4. 『小知识』怎么出来安全选项卡
  5. mac安装Solr流程
  6. 百度翻译开放平台API
  7. 调剂云南师范大学计算机专硕,云南师范大学2018年硕士研究生调剂公告
  8. python图片压缩算法_使用K均值算法进行图片压缩
  9. 判断sign签名(json格式)
  10. python123 凯撒密码,Python:Caesar代码,python,凯撒,密码