第一天上班的励志说说,怎么开通git shark?

3.3. Obtain the Wireshark sources3.3. Obtain the Wireshark sources
There are several ways to obtain the sources from Wireshark’s Git
repository.
Check out from the master branch using Git.
Using Git is much easier than synchronizing your source tree by hand using any
of the snapshot methods mentioned below. Git merges changes into your
personal source tree in a very comfortable and quick way. So you can update your
source tree several times a day without much effort.
Keep your sources up to date
The following ways to retrieve the Wireshark sources are sorted in
decreasing source timeliness.
If you plan to commit changes you’ve
made to the sources, it’s a good idea to keep your private source
tree as current as possible.
The age mentioned in the following sections indicates the age of the
most recent change in that set of the sources.
3.3.1. Git over SSH or HTTPS
Recommended for development purposes.
Age: a few minutes.
You can use a Git client to download the source code from Wireshark’s code
review system. Anyone can clone from the anonymous git URL:
If you create a Gerrit account you can clone from an authenticated URL:
ssh://:29418/wireshark
SSH lets you use Gerrit on the
HTTP lets you access the repository in environments that block the Gerrit SSH
port (29418). At the time of this writing (early 2014) we recommend that
you use the SSH interface. However, this may change as more tools take
advantage of Gerrit’s HTTP REST API.
The following example shows how to get up and running on the command
for information on installing and configuring
graphical Git and Gerrit clients.
Sign in to
using OpenID (click Register or Sign
In in the upper right corner of the web page). Follow the login instructions.
In the upper right corner of the web page, click on your account name and
select Settings.
Under Profile set a username. This will be the username that
you use for SSH access. For the steps below we’ll assume that your
username is henry.perry.
Select SSH Public Keys and add one or more keys. You will typically
upload a key for each computer that you use.
Install git-review. This is an installable package
in many Linux distributions. You can also install it as a
. (This step
isn’t strictly necessary but it makes working with Gerrit much easier.)
To install it from Chocolatey run
# Make sure "Scripts" is in our path
PS$&$env:path += ";C:\tools\python2\Scripts"
PS$&choco install pip
PS$&choco install git-review -source python
Now on to the command line. First, make sure git works:
$ git --version
If this is your first time using Git, make sure your username and
email address are configured. This is particularly important if you
plan on uploading changes.
$ git config --global user.name "Henry Perry"
$ git config --global user.email
Next, clone the Wireshark master:
$ git clone ssh://:29418/wireshark
The checkout only has to be done once. This will copy all the sources
of the latest version (including directories) from the server to
your machine. This may take some time depending on the speed of your
internet connection.
Then set up the git pre-commit hook and the push address:
$ cd wireshark
$ cp tools/pre-commit .git/hooks/
$ git config --add remote.origin.push HEAD:refs/for/master
This will run a few basic checks on commit to make sure that the code
does not contain trivial errors. It will also warn if it is out of sync
with its master copy in the tools/ directory.
The change in the push address is necessary: We have an asymmetric
process for pulling and pushing because of gerrit.
Initialize git-review.
$ git review -s
This prepares your local repository for use with Gerrit, including
installing the commit-msg hook script.
3.3.2. Git web interface
Recommended for informational purposes only, as only individual files can
be downloaded.
Age: a few minutes (same as anonymous Git access).
The entire source tree of the Git repository is available via a web
interface at . You can view each revision of
a particular file, as well as diffs between different revisions. You can
also download individual files but not entire directories.
3.3.3. Buildbot Snapshots
Recommended for development purposes, if direct Git access isn’t
possible (e.g. because of a restrictive firewall).
Age: some number of minutes (a bit older than the Git access).
The Buildbot server will automatically start to generate a snapshot of
Wireshark’s source tree after a source code change is committed. These
snapshots can be found at .
If Git access isn’t possible, e.g. if the connection to the server
isn’t possible because of a corporate firewall, the sources can be
obtained by downloading the Buildbot snapshots. However, if you are
going to maintain your sources in parallel to the "official" sources
for some time, it’s recommended to use the anonymous (or authenticated)
Git access if possible (believe it, it will save you a lot of time).
3.3.4. Released sources
Recommended for building pristine packages.
Age: from days to weeks.
The official source releases can be found at .
You should use these sources if you want to build Wireshark on your
platform for with minimal or no changes, such Linux distribution
The differences between the released sources and the sources in the
Git repository will keep on growing until the next release is made.
(At the release time, the released and latest Git repository
versions are identical again :-).Posts - 104,
Articles - 4,
Comments - 29
记录和总结web开发技术的点点滴滴...
13:37 by wish123, ... 阅读,
在push之前有时候会不放心是不是忘记加某些文件,或者是不是多删了个什么东西,这时候希望能够看看上次commit都做了些什么。
一开始想到的是用&diff,但是git diff用于当前修改尚未commit的时候较为方便,一旦commit后,需要指定上次节点的名称(一个hash值),不方便。这种时候用git log更合适,因为commit的内容会以log来记录。
下面记录几个常用的情境以及对应的命令。
仅仅想看最近谁有提交,以及提交的描述
对应命令 git log
显示Sample
commit fd6c9a3&Author: XXX&Date:&& Thu Nov 3 11:38:15
&&& fill author information in the head of files and format some code
commit 8e8a4a96e134dab8f045937efee35bd&Author: XXX&Date:&& Thu Nov 3 04:05:34
&&& user management is mostly complete
&&& details:&&&& add support for account disable/enable&&&& rewrite most related views to suit the above need&&&& provide two decorators for access control (see README)&&&& fixed many errors in Milestone 1
commit d8ad043d0da426a1&Author: XXX&Date:&& Mon Oct 17 20:19:04
&&& fix the bug of get_ori_url_from_shorturl().
commit b6cdd881a19ecaff838db7058fdd498a&Author: XXX&Date:&& Mon Oct 17 20:17:37
&&& fix the bug of get_article_from_short_url.
仅仅想看最后一次的提交
对应命令参数 -n 1
显示Sample
commit fd6c9a3&Author: XXX&Date: Thu Nov 3 11:38:15
fill author information in the head of files and format some code
想看到最近一次提交所有更改过的文件
对应命令 git log -n 1 --stat
显示Sample
commit fd6c9a3&Author: XXX&Date:&& Thu Nov 3 11:38:15
&&& fill author information in the head of files and format some code
Site/accounts/decorators.py&&&&&&&&&&&&&&&&&&&&&&& |&&& 2 +-&Site/accounts/forms.py&&&&&&&&&&&&&&&&&&&&&&&&&&&& |&&& 1 +&Site/accounts/models.py&&&&&&&&&&&&&&&&&&&&&&&&&&& |&&& 1 +&Site/accounts/readme&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& |&&& 3 ++-&Site/accounts/templates/account_activate.html&&&&& |&&& 1 +&Site/accounts/templates/account_disabled.html&&&&& |&&& 1 +&&
28 files changed, 37 insertions(+), 8 deletions(-)
想看到最近一次提交所有更改的细节
对应命令 git log -n 1 -p
显示Sample
commit fd6c9a3&Author: XXX&Date:&& Thu Nov 3 11:38:15
&&& fill author information in the head of files and format some code
diff --git a/Site/accounts/decorators.py b/Site/accounts/decorators.py&index 22522bc..a6bb440 100755&--- a/Site/accounts/decorators.py&+++ b/Site/accounts/decorators.py&@@ -1,9 +1,9 @@&#!/usr/bin/env&&# -*- coding: utf-8 -*-&+# author: Rex Nov. 3, 2011&from functools import wraps&from django.core.urlresolvers import reverse&from django.http import HttpResponseRedirect&-from django.utils.decorators import available_attrs&from Site.accounts.models import UserProfile
def login_required(view_func):&diff --git a/Site/accounts/forms.py b/Site/accounts/forms.py&index 016710b..778d92a 100755&--- a/Site/accounts/forms.py&+++ b/Site/accounts/forms.py&@@ -1,5 +1,6 @@&#!/usr/bin/env python&# -*- coding: utf-8 -*-&+# author: Rex Nov. 3, 201
有了这几条命令,基本上对于想看最近更改的情境就可以应付过去了。最后一条并不很常用,如果有visual的工具可能更直观些。wireshark开发简介——使用wireshark源码wireshark开发简介——使用wireshark源码成长映雁百家号1. 介绍从现在开始我们从wireshark源码着手,逐步进入wireshark源码的使用方法。下面我们要介绍的是:1)获取源码2)在我们自己机器上编译源码3)将自己的修改提交到官方版本本篇我们暂时不会介绍源代码的细节,敬请关注后续推出的文章。2.wireshark的git仓库git用于跟踪wireshark源码库的管理及变更跟踪,源码存储在wireshark.org官网的wireshark工程git仓库。所有针对官方库的修改,都将纳入gerrit代码审查(review)系统管理。gerrit让测试及修改讨论变得更容易,而这些是我们将代码Push到主仓库的必要流程。为什么使用git?git是一个高效、可扩展的代码管理工具,它支持大范围的分布式开发,并能确保数据正确。为什么使用gerrit?gerrit使得开发者更易于贡献代码,我们可以以任意openid登入并push我们的修改。它可以同时在web或者命令行使用,也已经被很多工具集成过。GIT是我们的第三个版本控制系统。wireshark最初使用Concurrent Version System(CVS),于2004年迁移到subversion,subversion仓库于2014年全部迁移到git仓库。使用wireshark的git仓库,我们可以:很轻易就能保持我们的私有源码处于最新;当官方源码变更的时候我们能及时收到邮件;从以前发布过的老版本中获取历史版本源文件;从web页面上快速浏览源码;查看任何代码的修改者;还有其他更多的功能,在此不一一列举。3. 从WEB界面访问GIT仓库我们可以使用gitweb在浏览器端快速查看wireshark源码:https://code.wireshark.org/review/gitweb?p=wireshark.a=tree我们还可以查看提交日志,分支,标签,以及历史修订:https://code.wireshark.org/review/gitweb?p=wireshark.git就像大多数版本控制系统一样,git使用分支来管理不同副本并且允许并行开发。wireshark使用以下分支管理官方发布版本:master:主要特性开发,以及奇数版本发布。master-x.y:稳定版本维护。如,master-1.10用于管理1.10.x官方版本。4. 获取wireshark源码有多种方式获取wireshark源码。4.1 git over SSH or HTTPS建议在开发环境使用。生命周期:几分钟。我们可以使用git客户端从wireshark的代码审查(review)系统获取源码,任何人都可以从下面匿名地址获取源码:https://code.wireshark.org/review/wireshark如果我们有gerrit账户,也可以从下面认证地址获取源码:ssh://your.username@code.wireshark.org:29418/wiresharkhttps://your.username@code.wireshark.org/review/wiresharkSSH允许我们在命令行使用gerrit。HTTP允许我们在受限环境下(gerrit的SSH端口29418被组织)访问仓库资源。目前我们推荐使用SSH接口。下面的示例步骤说明了如何在命令行运行:1)使用openid登入https://code.wireshark.org/review2)在页面右上角点击我们的账户名称并且选择设置(settings)3)在profile下设置用户名称,这个用户名称就是SSH的访问用户,在后续的步骤中,我们假定SSH的用户名为henry.perry4)选择SSH 公共秘钥,并且添加一个或多个秘钥,我们一般会为每一个工作机上传秘钥。5)安装git-review,这个安装包在多数linux环境下都是可用的,我们也可以将其作为python安装包安装。或者从Chocolatey安装:# Make sure "Scripts" is in our pathPS$&$env:path += ";C\toolspython2Scripts"PS$&choco install pipPS$&choco install git-review -source python6)现在我们在命令行确认git安装正确:$ git --version7)如果这是我们第一次使用GIT,确保我们的邮件地址及用户名都正确配置了,这项配置非常重要,关系着我们是否能成功提交代码:$ git config --global user.name "Henry Perry"$ git config --global user.email henry.8)接下来,将master分支clone下来:$ git clone ssh://henry.perry@code.wireshark.org:29418/wireshark这样我们拿到的是最新的主分支代码。9)接下来设置git pre-commit hook以及push地址:$ cd wireshark$ cp tools/pre-commit .git/hooks/$ git config --add remote.origin.push HEAD:refs/for/master这样会在提交之前执行一些基础的检查,以确保代码能避免一些小错误。如果发生与主分支tools/目录不同步的情况,也会出现警告。10)初始化git-review$ git review -s这会帮助gerrit准备使用本地仓库,包括安装commit-msg hook脚本至此,代码获取及前期准备相关事宜都已经完毕,接下来我们将会讨论在不同平台上的构建、发布问题。本文由百家号作者上传并发布,百家号仅提供信息发布平台。文章仅代表作者个人观点,不代表百度立场。未经作者许可,不得转载。成长映雁百家号最近更新:简介:一万年太久,只争朝夕. ——毛泽东作者最新文章相关文章3.2. The Wireshark Git repository3.2. The Wireshark Git repository
is used to keep track of the changes made to the
Wireshark source code. The code is stored inside Wireshark project’s Git
repository located at a server at the wireshark.org domain.
Changes to the official repository are managed using the
code review system. Gerrit
makes it easy to test and discuss changes before they are
pushed to the main repository. For an overview of Gerrit see the
Git is a fast, flexible way of managing source code. It allows large
scale distributed development and ensures data integrity.
Why Gerrit?
Gerrit makes it easy to contribute. You can sign in with any OpenID
provider and push your changes. It’s usable from both the web and
command line and is integrated with many popular tools.
Git is our third revision control system
Wireshark originally used
(CVS) and migrated to
in July 2004.
The Subversion repository was subsequently migrated to Git in January 2014.
Using Wireshark’s Git repository you can:
Keep your private sources up to date with very little effort
Get a mail notification when the official source code changes
Get the source files from any previous release (or any other point in time)
Have a quick look at the sources using a web interface
See which person changed a specific piece of code
and much more
3.2.1. The web interface to the Git repository
If you need a quick look at the Wireshark source code you can
browse the most recent file versions in the master branch using Gitweb:
You can also view commit logs, branches, tags, and past revisions:
Like most revision control systems, Git uses
manage different copies of the source code and allow parallel development.
Wireshark uses the following branches for official releases:
master: Main feature development and odd-numbered "feature" releases.
master-x.y: Stable release maintenance. For example, master-1.10 is used
to manage the 1.10.x official releases.git 有两个分支 a、a-&b, a 有更新以后用什么语句更新到 b? - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
已注册用户请 &
git 有两个分支 a、a-&b, a 有更新以后用什么语句更新到 b?
11:28:50 +08:00 · 3411 次点击
a :当前线上版本,需要不断修复 bug
b :来源于 a ,在 b 上面开发新模块
两个分支都要保留,不能删除。
在 a 上面更新代码以后,怎么也更新到 b ?
27 回复 &| &直到
23:18:30 +08:00
& & 11:32:20 +08:00
git checkout a & git pull & git checkout b & git rebase a
& & 11:33:58 +08:00
线上分支不应该直接在上面更新代码吧
& & 11:40:09 +08:00
看看 git flow 流程, A 分支有 bug 应该新开一个 /hotfix 分支,修改上线后合并到 B 的 feature 分支
& & 11:43:29 +08:00
@ 你是不是看错需求了?@ 啥意思?
& & 11:45:08 +08:00 via Android
@ 我觉得我写的满足了你的需求。
& & 11:45:26 +08:00
似乎只能使用 rebase 了
& & 11:48:25 +08:00
merge/rebase 有问题吗? 一楼的说的应该没问题吧
& & 11:50:21 +08:00
切到 b 然后 rebase a
& & 11:52:53 +08:00
这种开发模式是非常典型可以用 Git 最佳实践的。请参考:
& & 11:55:39 +08:00
一楼可行,不想切分支的话可以这么搞,效果相同: 在 b 上 git pull --rebase origin a
& & 11:59:14 +08:00
一种做法是走 rebasegit checkout bgit rebase a我觉得更好的做法是每一个 BUG 都从 a 拉出一个分支,这个分支开发完后同时 merge 到 a 和 b
& & 12:09:55 +08:00
@ @ @ 先谢谢回复rebase 或 merge 会删除分支吗?
我的需求是 a 、 b 分支都不能消失
& & 12:12:32 +08:00
cherry-pick 看是不是你想要的
& & 12:23:17 +08:00
如果不是“同步”分支,建议 cherry-pick
& & 12:34:12 +08:00
@ 不会,分支只有你手动才删得掉,其它任何操作都不会删除分支
& & 12:48:22 +08:00
git checkout a -& git merge b 吗?
& & 12:49:16 +08:00
cherry-pickcherry-pickcherry-pick
& & 12:49:39 +08:00
少量提交可以用 cherry-pick多一点的提交,看看能不能用 rebase
& & 12:53:48 +08:00
如果能 merge --ff-only, 也可以这样
& & 12:55:36 +08:00
建议楼主先熟悉一下 git 基础和 git-flow , 楼上说的 rebase/merge/cherry-pick 都可以,用哪种方法完全取决去个人爱好,洁癖用 rebase强迫症用 merge爱折腾用 cherry-pick
& & 13:11:51 +08:00
在 b 上 merge a 就可以了啊,没有什么必要 rebase 。cherry pick 会产生很多新的 commit ,更没有必要了。
& & 13:32:09 +08:00
@ 用 b rebase a 就可以了啊,没有什么必要 merge 。
& & 13:34:42 +08:00
rebase 被玩坏了
& & 13:56:35 +08:00
建议用 mergerebase 可能会导致 non-fastforwardcherry-pick 少量 commit 没问题,多了累
& & 14:03:21 +08:00
没有争议的问题 为啥还讨论这么激烈 蛋疼
& & 14:18:26 +08:00
git rebase -i &branch& 是正确的用法
& & 23:18:30 +08:00
On branch B1. branch_b cleangit merge branch_a2. branch_b can not merge before commitgit stashgit merge branch_a* may need fix confilct thengit stash pop遇到不可合并的二进制文件,需要重新 git checkout file
& · & 1830 人在线 & 最高记录 3762 & · &
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.1 · 23ms · UTC 10:45 · PVG 18:45 · LAX 03:45 · JFK 06:45? Do have faith in what you're doing.}

我要回帖

更多关于 第一天上班害怕怎么办 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信